11.15. How should I learn/start-learning MFC?

I see this posted lots. To start with, check out section 2.4.2 of this FAQ, books always help. Another good point is that you can't really get down and dirty in MFC without knowing and understanding the underlying Windows API, so you might want to start with an overview of that. (The 'Petzold' book is the classic here) At the very least get a feel of what windows does and what it's capable of.

Another hint I have is don't rely too much on the Wizards, these are great, but they sometimes shield the newbie too much. Take a look at what AppWizard/ClassWizard has done for you, run the debugger through a mainfrm.cpp, etc.. You won't understand what the heck is going on until you understand what your magically generated code is doing.

I thought the 'writing windows apps with MFC' book was a good merge between Petzold and intro MFC stuff. 'Inside Visual C++' may move too fast for someone that doesn't know Windows already.

scot@stingray.com, 7/27/95

raymond@btw.com, mfc-l, 7/23/95

Start with the VC++ User's Guide and work your way through the Scribble Tutorial. You get an intro to VC++ and MFC and see how they work together. Then there are numerous articles on the MSDN CD to help with basic concepts. Try searching on MFC and Architecture. Don't shy away from reading the MFC Encyclopedia articles (they take more of a 'how-to' approach) and by all means become familiar with the MFC Technical Notes. Also (hint), stay focused on the 32-bit stuff if you're just starting out. There are also a number of excellent journals out there to help.

billb@microsoft.com, mfc-l, 7/23/95

The important points (of the top of my head) are:

If you're a windows programmer, don't worry about graphics.  The CDC member functions are an almost direct encapsulation of the Windows functions. Also CWnd encapsulates much of the window manipulation functions.

Learn the Document-View architecture: document templates, the interaction between the application, the documents and views (AfxGetApp, GetDocument, UpdateAllViews etc).

Learn serialization (scribble makes a good intro to it). DDX and DDV for dialog boxes: there is a good tech note on this. WM_COMMAND handlers, COMMAND_UI handlers (which allow you to enable/disable menu items as well as applying check mark and radio button marks on menu items, it also gives you one way to use status bars).

During all this you'll also learn how to use ClassWizard and see how it is integrated with the editor and resource editor. Perhaps as part of the MFC FAQ we could create a list of topics (ordered in terms of importance) to learn? {Sure, this is a good start, no? -Scot}

grimes@parallax.co.uk, mfc-l, 7/24/95