Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
can i code Graphical User Interface using c++?
Posted
Comments
Sergey Alexandrovich Kryukov 26-Oct-13 1:26am    
How can we know what you can and what cannot?
I doubt you can, here is why: if you could, you would at least tagged the platform you want to work at, some your goals and other detail.
—SA
Remaxx 26-Oct-13 6:30am    
Thanks sir, thats what i want
Sergey Alexandrovich Kryukov 26-Oct-13 20:28pm    
What then you would not add some relevant information?
—SA
Captain Price 26-Oct-13 6:08am    
You should be asking "What are the ways to write a GUI using C++ ?" !
Remaxx 26-Oct-13 6:28am    
thats what i was trying to ask.

There're a few options for creating GUIs using C++. I guess you are using Windows(you should've mentioned it and as many use it). So the most common options available are;

1. The Win32 API (Base of all other APIs/Libraries on Windows).
2. MFC/WTL.. (Windows specific GUI libraries)
3. QT/GTK+... (Cross-Platform GUI libraries)
4. .Net with C++ (Managed C++)

An operating system is described by its API for the programmer. So on Windows the layer which connects the operating system and a software is the Win32 API (which also includes creating GUIs). Windows API(another name for Win32 API) is faster than other frameworks (MFC, QT....) but it's a lot of code than other frameworks which are available. So the only con of the Win32 API i see is that it takes much more time and effort to develop with.

Note:API is the least of many factors which affects the execution speed of a program. Some .Net programs can be faster than some Win32 programs if you do not write code properly.

All the other frameworks and APIs (MFC, QT, GTK+, .Net, WTL, ATL,.....) are build on top of the Win32 API. MFC is just a thick layer which wraps the Win32 API into C++ classes (since Win32 API is in pure C) making it somewhat easier to program with.

QT and GTK+ are cross-platform. You don't need to (in many cases and not always) change your code when compiling for different platforms.

I think it's not so effective to use C++ with .NET, because you can use C# with .Net.

If you learn the Win32 API first, you'll understand more about how an OS works. Generally if you're going to use MFC and/or WTL you should learn the Win32 API first. Learning QT and/or GTK+ will be the easiest. Qt is more recommended these days. Qt is great if you quickly want to create a GUI.

Resources:
1. Win32 API - Programming Windows - Charles Petzhold (for reference)

2. MFC - google for tutorials (MFC is very easy once you understand something in Win32)

3. For QT/GTK+ they're a lot of tutorials online.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900