Advertisement

C++, GUIs, and lots of pain

Started by December 22, 2002 04:35 PM
7 comments, last by Phathead 21 years, 10 months ago
Hi everyone, Here is a simple question. Can anyone direct me to a website/book/article that explains in detail how C++ GUI programming (using MFCs) is done. All this talk of Message Mapping is making me dizzy. I've seen some good articles, namely one written by Jean Michael and one written by Brian Martin. The former is pretty good but doesn't go into enough detail for me to have good use out of it. Besides, I don't want to only copy & paste code, I want to actually understand what's going on. Now, the reason for all this is because I have a predesposition that I can't fully know how to develop games using DirectX until I actually understand how to make an operational win32 application. I've made a few games in QuickBasic (a loong time ago) before I went to college, and since then we've been learning Java (ugh) and data structures and such, so I'm not unfamiliar with basic programming concepts and their applications -- except for GUIs. I think they refuse to teach us GUIs here. I don't know why, it seems like a pretty complex topic. So, long story short, can someone help me? I don't mind forking out $50 for a good book, but I need to know that it's a good book, I don't want to blindly buy a book and find that it sucks. Thanks everyone, Phathead [edited by - Phathead on December 22, 2002 5:36:32 PM]
-- WANTED: Infinite amount of monkeys willing to work for an infinite amount of time on infinitely many computers. Goal: write the best video game ever. Contact planetOfAPIs@imadork.com
First, do you know C/C++ itself? If not, learn the language first, before you learn API''s.

Next, DO NOT learn MFC. MFC is bloated crap. Learn how to use the Windows API. The book I used to learn how was called "Turbo C++ Programming for Windows", and was very good, although probably out of print by now, and outdated (it was for Win 3.1). You can probably find a lot of good Windows API tutorials online. Plus 99% of game programming books come with a brief Windows API tutorial.

- Andy Oxfeld
Advertisement
first of i completly disagree with AndyOxfeld about not using mfc. However if you are using mfc for creating game GUI then dont use mfc, otherwise i found a good book to be Introduction to MFC Programming With Visual C++ by Richard M. Jones, its one of those books that doesnt go into using appwizard stright away but instead teaches you how to create MFC GUIs hand coded.
However, its intermediate to advanced book so be sure you know c++ before attemting to read it.

[edited by - com on December 22, 2002 5:51:03 PM]
Yeah, I do know the basics of C++ (i.e. pointers, structs, classes, and all the compatible concepts from java). I know that there are a few good books for swing and awt. Is there anything like this for C++? My roomate has an older book from 1998 -- I know in java, for instance, the compiler complains when you use outdated classes. Does C++ do this?

Thanks again,

Phat

P.S. Com, yes, I will probably build on this knowledge to develop video games.

[edited by - Phathead on December 22, 2002 5:56:59 PM]

[edited by - Phathead on December 22, 2002 5:58:10 PM]
-- WANTED: Infinite amount of monkeys willing to work for an infinite amount of time on infinitely many computers. Goal: write the best video game ever. Contact planetOfAPIs@imadork.com
It *can* complain if there is something in the header that conditions it to happen (like using iostream.h instead of iostream, that will through a warning, but not an error)

Other than that, most C++ compilers don''t care how old a class is.
I think MFC is a good productivity tool, but a horrible teaching tool. It wraps around the win32 API so much in some places that you have no idea what the hell it is you''re doing anymore. When something goes wrong, or doesn''t work exactly how the book says it should, you''re screwed.

I tried learning MFC before win32 and it was OK at the beginning, but more and more I found myself having to backtrack to win32 to even understand what the hell MFC was trying to do. I''m mostly ignoring MFC for now until I get a better foothold in win32.

It''s like learning to divide by using a calculator.

My 2 cents.
Advertisement
I like "Programming Microsoft Visual C++" by Kruglinksi, Shepherd and Wingo and "Programming Windows with MFC" by Jeff Prosise. The first gives you some explanation while mainly using the Appwizrd. Its a good book for finding out to get something done quickly and easily. The Prosise book goes into a great amount of depth and detail. If you mastered all of the material in the Prosise book, you''d probably know more about MFC than most professional windows programmers. Even if you don''t go through it all, it''s good as a reference book (this is how I have mainly used it).
It''s not unusual to directly access the win32 api even when using MFC (sometimes it''s necessary or much easier), so I also have a copy of the Petzold book.
The most useful thing, I have found, once you start writing actual apps, is to have a copy of MSDN. The documentation in it is, for the most part, very good.

The above mentioned book by Jeff Prosise rocks. If you plan on doing any MFC apps, get this book!

And MFC is VERY useful in my opinion. I wrote a ton of useful tools using MFC. They probably weren''t as fast as what I could write using pure windows API, but that really didn''t matter. I''ve recently switched to writing all my tools in Java, since platform independance is pretty sweet. But if I ever need to write a windows only app, I''ll be using MFC (or .NET which is actually pretty cool).
He''s a bad motha - Shut yo mouth.
If you wish to learn MFC then the Kruglinski and Prosise books mentioned above will be excellent. However, if you are hoping to learn windows programming as a stepping-stone onto DirectX programming (this is what I am doing), then don''t concern yourself too much with MFC, but learn about the Win32 API. The ''bible'' of Win32 is ''Programming Windows'' by Charles Petzold. I think the latest edition is the 5th. Its a huge book, but should be the only one you need before moving onto a DirectX or other games book.

Caroline M.
Caroline M

This topic is closed to new replies.

Advertisement