How C++ GUI programming

Hello,
I am new to make programs. So far I can just do logical stuff like math in a dos window. I now want to move on to making actual windows programs. Does anyone know how to make a GUI in C++ for a windows application? Any reading online or in a book that I can look up?
Widgetry programming takes a slightly different mindset.

I would recommend getting a cross-platform widgetry lib like Qt or wxWidgets, as they're typically easier to use (and cross platform). Google them, download/install them, and use the tutorials to make some simple programs.

Otherwise, if you just want to stick with WinAPI, you can do that. Just search for some getting started with WinAPI tutorials.
what should I use to write good programs ?
qt ?
WinAPI ?
For developing Windows GUI applications you'll want eventually to learn Win32 functional model or MFC OOP equivalent. There are a lot of tutorials out there, but all of them are based on Microsoft's official MSDN support. If you want recommendations, may considering taking them from the Microsoft's MSDN itself:
http://msdn.microsoft.com/en-us/library/aa235484(v=vs.60).aspx

It is worth mentioning another light-weight alternative that might be more appropriate for beginners - the so-called "unsupported" WTL:
http://msdn.microsoft.com/en-us/magazine/cc163305.aspx
Can I read this book ?

C++ GUI Programming with Qt 4, Second Edition
What is the difference between MFC and Qt
MFC is Microsoft Technology, Qt is Nokia's. The first is heavily supported on the Windows platform and as far as I know, it doesn't have a restricted license, whereas Qt is a multi-platform (benefits and drawbacks) and is GPL with special commercial licence offer. That would mean Microsoft takes it's share by selling the MsVisualStudio, but you may use MFC freely on Windows with anything you can, with or without Microsoft's official products. Qt is free anywhere, any time, as long as your products are free as well, and you pay only the commercial usage, regardless of platform.
There is a lot to go about possible differences! You'll have to study them both in order to get a real useful conclusion. As a starting reference, I might say that almost any Windows SO GUI is MFC, and the Qt would be the main engine behind the K Desktop Environment on Linux.
Qt's first license is actually LGPL. This means you may create proprietary applications with it, but you have one or two limitations.

-Albatross
Last edited on
you can also drag and drop on visual studio :o
I use Qt and I like it very much :)
It's so damn easy lol
closed account (z05DSL3A)
Qt's first license is actually LGPL.

QT is licensed under three different licenses; Qt Commercial Developer License, Qt GNU LGPL v. 2.1, and Qt GNU GPL v. 3.0.
http://qt.nokia.com/products/licensing

Make sure you understand the licensing implications before you start with Qt.

MFC is a framework (object oriented) that wraps Windows API (procedural based). MFC uses a lot of 'macro magic' to disguise the underling API, this leads to confusion in some people. By this I mean that if you are the sort of person that likes to know 'how clicking a button here gets to running that code there', then it may better to learn some basics of Windows API first.

One problem with learning MFC and/or Windows API, is the lack of 'up-to-date' resources, Microsoft are pushing the .net framework as the way for new programmers to go. Try to avoid falling into the trap of thinking .net is the way to do GUIs on windows.

For me, I plunged into Window's programming at work. In my experience regardless of A.P.I. it is still very worthwhile knowing the underlying technology, the Window's A.P.I..

It's also important to know that Window's programming being message orientated, takes a slightly different mindset to tackle than your run of the mill console application.

Here are a few tutorials that got me started:

Window's A.P.I.:
http://www.winprog.org/tutorial/start.html
http://zetcode.com/tutorials/winapi/

M.F.C.:
http://www.functionx.com/visualc/index.htm

Granted some of these tutorials are a little dated but I found them useful.

I hear great things about Qt, from people on this board and work colleagues who have used it, so it might be a good idea to research it.

Good luck and I hope this helps!
Did the same things Windows API and MFC ?
Did I understand wrong ?

firix wrote:
Did I understand wrong ?
Yes and no. All you need to understand is that the M.F.C. is the Window's A.P.I. but with a shiney object orientated wrapper. What I mean to say is the M.F.C. is just an amalgam of the various parts of the Window's A.P.I. in an object orientated structure.

Here are two links that might help further your understanding:

Windows A.P.I:
http://en.wikipedia.org/wiki/Windows_api

M.F.C.
http://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library

Do some tutorials, then it will click.
Thank you everyone for your responses.
Topic archived. No new replies allowed.