The MFC Files

When you finish, AppWizard creates a "project," including a set of files that contain the basic elements of an MFC application, implemented as C++ classes:

Note For more information about documents and views, see Documents and Views.

What you get in the files created by AppWizard is an application-specific C++ class derived from each of the following MFC base classes: CDocument, CView, CFrameWnd (or CMDIFrameWnd and CMDIChildWnd), and CWinApp. By virtue of C++ inheritance, these classes contain all the behavior of their base classes plus whatever you choose to add to them. The rest of this migration guide concerns what you add and why and where you add it.

Figure 4 shows the objects in a running MFC SDI application and how they communicate.

The parts of this framework that you'll use in the procedure described in this migration guide are quite limited. You'll move most of your code into three functions in your MFC application's view class, derived from CView. That move takes you a long way. Eventually, you can move parts of your message handling code into other functions in other classes (see Phase 2).

Even before you add a line of your own code to the MFC skeleton that AppWizard creates, you can build the project and run the skeleton application. The application lets a user open windows, some of the menus already work, some of them bring up dialog boxes, and the application has any features you selected when you ran the wizard —such as a toolbar, a status bar, an About dialog box with a 3D look, and so on (for SHOWDIB, you omitted some options). You're looking at the tip of the MFC iceberg; MFC — an "application framework" — implements a great deal of standard Windows functionality that you don't have to program yourself.

Try out the skeleton by compiling and running it now. Then you can start filling in the skeleton.