The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

C++ and Win32: Starting Out

I want to learn how to build GUI apps with Visual C++ .NET. I don't know anything about Windows programming, and there's just too much information out there to find any direction.

My first project will be a tiny app that listens for events through COM, filters, and then pushes the result to a web service.

I know that C# or VB.NET is probably much better suited for something like this, but I just want to see how horrible it really is to build a C++/Win32 app. Even though nobody writes a lot of machine language anymore, it's still fascinating. Please don't try to sell me on VB6 or Swing or .NET or Delphi or wxPython or anything else.

I think my first decision to make is whether I should start with MFC or the Win32 API or ATL. I understand that MFC wraps up the Win32 API, but that it does it rather badly. I don't really know how the ATL fits in. That's all I've got.

Wednesday, December 15, 2004
Read the MSDN documentation for the "RegisterClass" and "CreateWindow" functions.
Kalani Send private email
Wednesday, December 15, 2004
Raymond Chen's blog is a good place to find discussion of the Win32 API: is the base program he uses for API examples.  It's about as basic a windows program as you can get.

The code archive has lots of other examples that build on this program:
Doug Send private email
Wednesday, December 15, 2004
Forgot to address ATL/MFC...I would suggest doing a little with the Win32 API itself and then picking up some ATL for the COM stuff you want to do.  ATL originated as a helper library for COM and is better suited to that than MFC.  You can also use ATL for basic windowing tasks.  That should be easy with some foundation in the Win32 API.
Doug Send private email
Wednesday, December 15, 2004
There's also a ATL extension called WTL that's more light-weight GUI than MFC. You can download the latest version from Microsoft downloads.
Thursday, December 16, 2004
If your just interested in learning start with bare Win32.

I wouldn't bother with MFC anynore, its really horid so unless you have to maintain existing code I would avoid it.

If you want to do any COM programming I'd start without ATL, its a lot more work but you will learn a lot of important stuff. I think it took me two weeks to create my first basic COM object, the ATL wizard could do it in seconds but you wouldn't learn anything.

If you start seriously writing COM objects then go down the ATL route, it will make life a lot easier.

If you start seriuosly writing Windows apps then look at WTL.
Tony Edgecombe Send private email
Thursday, December 16, 2004
I second using WTL. It is an excellent way to writing good Win32 software, and is far superior to MFC. I daresay that it is enough to use even when compared to the .NET technology. I think WTL is also excellent for learning, as you can easily trace through how all the classes work, which you wouldn't easily do (or can easily trace) using MFC, and which can't be done at all with VB, .NET etc. Finally, WTL does achieve a huge amount of portability as it is not too tied in with the operating system version, and it does not require any DLLs to be distributed to make your app run. Our updating application at needs to be small, OS version independent and free of additional libraries, so using WTL was particularly ideal for us.
Simon@AutoUpdate+ Send private email
Thursday, December 16, 2004
Anyone have experience with the win32gui template library? Here:

I was initially extatic, but Hello World compiled to 1 megabyte and it's not very well documented. Other experiences?
The Legendary Stalker Send private email
Thursday, December 16, 2004
I would also suggest looking at WTL after the basics of pure Win32 API programming is understood. WTL is very nice, and fairly easy to use once you figure it out. It doesn't get in your way like MFC does, you can use it as a tool to help you wherever you want to, and ignore it where it doesn't make sense.
Thursday, December 16, 2004
There seems to be a fair amount of information on plain WinAPI + C++ at .  They also have an online book C++ in Action that I really like so far.
Thursday, December 16, 2004
I used "Windows Programming for Dummies" when I started with Win32. I couldn't get it till I read this book. (Should I be ashamed?)

I happen to think MFC is decent, maybe not the greatest, but decent.
naveed Send private email
Thursday, December 16, 2004
I also like to use WTL and have used it in printer drivers for a large company.  My shareware was all MFC and then I converted it to WTL and it ended up being so much smaller in size.  I have even had a chance to sit down with Nenad (developer of WTL) at Microsoft for a coke on campus.  I always say that its what MFC was suppose to be, a small wrapper around SDK calls.
Steve Send private email
Thursday, December 16, 2004
Thanks everyone, this is more than enough to keep me busy for now.

Friday, December 17, 2004

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz