Ex03a: The "Do-Nothing" Application
The MFC Application Wizard generates the code for a functioning MFC library application. This working application simply brings up an empty window with a menu attached. Later, you add code that draws inside the window. You take the following steps to build an application:
Run the MFC Application Wizard to generate SDI application source code. Choose New Project from Visual C++'s File menu. Select Visual C++ Projects, and then select MFC Application from the list of templates, as shown here.

Type C:\vcppnet\ in the Location box. Type Ex03a in the Name box, and then click OK. Use the links on the left side of the dialog box to move through the various Application Wizard pages to set up project options.
On the Application Type page, select the Single Document option and accept the defaults for the rest of the application, as shown here:

On the Generated Classes page, shown below, notice that the class names and source-file names have been generated based on the project name Ex03a. You can make changes to these names at this point if you want to. Click Finish. The wizard will create your application's subdirectory (Ex03a under \vcppnet) and a series of files in that subdirectory. When the wizard is finished, look in the application's subdirectory.

Table 3-1 lists the files that are of interest (for now).
File | Description |
---|---|
![]() | A project file that allows Visual C++ .NET to build your application |
![]() | A solution file that contains a single entry for ![]() |
![]() | An ASCII resource script file |
![]() | A view class implementation file that contains CEx03aView class member functions |
![]() | A view class header file that contains the CEx03aView class declaration |
![]() | A text file that explains the purpose of the generated files |
![]() | A header file that contains #define constant definitions |
Open the


Compile and link the generated code. In addition to generating code, the MFC Application Wizard creates custom project and workspace files for your application. The project file,



Solution Explorer contains a logical view of your project. The header files show up under Header Files, even though they are in the same subdirectory as the CPP files. The resource files are stored in the \res subdirectory.
Test the resulting application. Choose Start Without Debugging from the Debug menu. Experiment with the program. It doesn't do much, does it? (What do you expect with no coding?) Actually, as you might guess, the program has a lot of features—you simply haven't activated them yet. Close the program window when you've finished experimenting.
Browse the application. Press CTRL+ALT+J to bring up the Object Browser. If your project settings don't specify browser database creation, Visual C++ .NET will offer to change the settings and recompile the program for you. (To change the settings yourself, choose Properties from the Project menu. Open the C/C++ folder, click on the Browse Information property page, and change the Enable Browse Information property to Include All Browse Information (/ FR).)After you expand the hierarchy, you should see output similar to this:

Compare the browser output to Class View:

Class View shows the class hierarchy, much like the Object Browser does. But the Object Browser shows all the functions available on a class, and Class View shows only those that have been overridden. If Class View is sufficient for you, don't bother building the browser database.