Kredns
Kredns

Reputation: 37201

Windows GUI C++ Programming

I want to learn C++ GUI programming using Visual Studio 2008. I'm not sure where to start though. I learned C++ in high school, but not GUI. I've been doing C# for about 3 years now and thats how I "learned" GUI programming. Now I want to learn how to write GUI's without the use of the .NET framework, so where do I start?

Upvotes: 9

Views: 13980

Answers (7)

Sazid
Sazid

Reputation: 2827

As of now (Windows 8), WinRT, a completely new API has been brought to the audience by Microsoft and I'm quite excited about it. Never done MFC programming, but saw some code samples and they look weirdly 90's C-style (modern C-style is often better!). So, without going to start directly with MFC, I think I will start with WinRT

:)

Upvotes: 0

Diones
Diones

Reputation: 1481

Ah I know how you feel, old interpreted languages programmer that want to know the magic behind compiled programing. Well I can't find the tutorial that I used to learn windows programing, but just know that there is good win32 tutorials around, so you don't waste your time buying a book just yet. I found it: http://www.relisoft.com/win32/index.htm Neatest tutorial around, trust me.

Upvotes: 2

anand
anand

Reputation: 11309

MFC is almost outdated now. I would recommend to use WTL instead .

Well it is also not a good idea just to start programming for GUI in C++ when there are so many good frameworks available like QT cross platform framework.

Upvotes: 7

anon
anon

Reputation:

Some heretical opinions...

I wouldn't recommend C++ for writing complex Windows GUIs - language/library combos like C# or Delphi are so much more productive. If you want to get into C++ programming I'd suggest using it to write a multi-threaded server of some sort - a simple Web server would do for starters.

And if you really want to understand the underlying Windows APIs, I think there is something to be said for writing a simple application (like, say, a simplified version of notebook) in C (not C++). You'll only want to do it once, but you will learn a lot in the process.

And before anyone starts madly down-voting, let me say that I am a C++ programmer of over 20 years standing, and really love the language.

Upvotes: 5

Glenn
Glenn

Reputation: 8032

Would it be OK with you to write GUIs in VC++ using Microsoft Foundation Classes or MFC? That is how I would and have written VC++ GUIs in the past.

There have been many books written on MFC over the years. I'm sure any one of them will do nicely. You may find in the literature the reference ATL which is a Microsoft iteration on STL. MFC and ATL kind of merged over the years so anything ATL is also applicable to an MFC app these days.

Good luck and have fun!

Upvotes: 2

Nicholas Piasecki
Nicholas Piasecki

Reputation: 25573

Since you say you've been doing C# GUI programming for about 3 years, I'll assume that means Windows Forms. One way to dip your toe in the water is to remember that WinForms is really just an object-oriented wrapper around user32. So load up Reflector and take a look at the way some of the controls are implemented. You'll see that these strange messages like WM_PAINT and WM_KEYDOWN are pumped to the WndProc of the various controls by Windows. In plain old Win32 or MFC programming, the same thing is still going on. Doing this will let you slowly peel back the layers of the onion; you'll get a better feel for how Windows Forms works, too. From there, I'd recommend picking up Programming Windows by Petzold; it's old, but the native APIs in Windows don't move around that much. Have fun!

Upvotes: 8

BobbyShaftoe
BobbyShaftoe

Reputation: 28499

Charles Petzold's "Programming Windows 5th Edition" is the Bible for Windows programming.

http://www.charlespetzold.com/pw5/

Upvotes: 8

Related Questions