Tuesday, July 28, 2009

Making a GUI in C++?

I'm a beginner in C++ and I am currently taking a intro class for my computer engineering degree. We just got into pointers and classes so I guess that's still the intro stage. My question is for you advanced programmers out is what is there to learn after you master the basics like after classes, arrays, pointers ect? What are more topics to learn? I want to learn how to make a windows GUI like where you click "ok" "exit" ect. like a visual basic sort of program using C++. How would you learn that? Is there any good online resource or book I can buy? This is still far off from my skills but it never hurts to look ahead.

Making a GUI in C++?
You should definitely learn the Windows API before you start making GUIs with .NET or a GUI builder. If you go right in and do them like in VB, you won't learn that much (and if you have the curiosity to look ahead, I'll assume you probably want to really learn what you're doing).





It's very hard, and it takes a lot of code to even bring up a window. You have to learn a little about how windows works under the hood.





With that said, when you get a solid grasp of C++, read this tutorial. http://www.winprog.org/tutorial/start.ht... This tutorial is for the C language, not C++, but everything is pretty much the same, and when you get to the level where you can understand what's going on, that aspect shouldn't be a problem.





Good luck!
Reply:Learn Win32 API - it gives you full power to create anything you want in Windows. It is a bit complicated though. Gonna take you ~60-70 lines of code just to display "Hello World" but it is worth it. The one and only book you need is "Programming Windows 5th edition" by Charles Petzold.





Your other option is to learn C# and use .NET to create GUI's. Oh, and one more thing, stay away from MFC (Microsoft Foundation Classes)!


No comments:

Post a Comment