I have been reading your articles for a couple of years. However, I did not need to write Windows-based applications using MFC until recently. The worst thing is that I need to learn how to write Windows-based applications using MFC in a short time. I have been reading Inside Visual C++ from Microsoft Press. It seems to me that there are millions of WM_ messages and class member functions. With some of them, it is obvious what they will do. However, I have not figured out a way to find out what may be available to use in different situations. For someone who knows the basics of how Windows works, the structure of MFC classes, and object-oriented programming, what are the best resources to learn about programming for Windows using MFC?
I would try to memorize all the MFC classes and their member functions and software development kit APIs, if only my memory did not get lost, like my Windows-based applications. I am a Developer Network Level 2 member, and I have purchased all the MFC Windows programming materials that I know of. Now it is time to see my GUI doctor for help. Maybe you can prescribe some medicines to fix my memory problem.
My second question is easy. VLIST, the virtual list box sample in the Microsoft Development Library, is written in C using the SDK. Is there an equivalent example using MFC?
Getting a free T-shirt is nice, but I would rather have Dr. GUI answer my questions. Why don't we make a deal? If you answer my questions, you save a T-shirt. Ha ha!
W. Wong
Some medicines are hard to take. The syrups taste bad. The pills are big, and if they don't get stuck in your throat, they upset your stomach. My prescription for you is going to be a hard pill to swallow: Read the documentation. The best tutorial for learning how to use the Microsoft Foundation Class Library (MFC) is the Scribble tutorial in the Visual C++ manual. Following along with the creation of the Scribble sample application will get you on the road to recovery in less than two days' time.
Once you have done the tutorial, there is no need to memorize all the application programming interface (API) functions and classes. You can press f1 to get Help or Books Online while running Visual C++. Even better, leave the Microsoft Development Library running, so that it's just an alt+tab away with answers to your questions.
In most cases, MFC is a loose wrapper around the Win32 API. If you know Win32, you should have little difficulty transitioning to MFC. The biggest difference between an MFC application and most Windows-based applications in C is in the document/view architecture and in the handling of menus. The Scribble tutorial covers these issues very well.
You are definitely on the right track reading Inside Visual C++ and the Development Library.
Regarding an MFC version of VLIST, I'll quote my college physics textbook: "That is left as an exercise for the reader." Seriously, we don't currently have plans to make an MFC version of the VLIST sample. The new hierarchical control introduced by Windows 95 replaces much of the need for an MFC version of VLIST. For more information, check out the wonderful, soon-to-be-published-by-Microsoft-Press book on Windows 95 by Nancy Cluts, which contains every sample on the Development Library CD in C, C++, MFC, Small Talk, SNOBOL, and Swahili.