Using AppWizard to Create the Starter Application for Scribble

In this topic, you will:

  • Use AppWizard to create the starter application that forms the beginnings of Scribble

  • View the starter files and classes using the Project Workspace

  • Compile and run your starter application

Suggested Reading in the Visual C++ User’s Guide

Note   The following procedure describes how to enter the correct values for Scribble. Many of the AppWizard dialog boxes contain choices that you won’t use to create the starter files for Scribble.

New Dialog Box

To create starter files for Scribble

  1. On the File menu, click New.

    The New dialog box appears.

  2. In the New dialog box, click the Projects tab. Select MFC AppWizard (exe) in the list box.

  3. Fill in or select the remaining boxes as follows:

    • Create new workspace option button: activated.

    • Project Name box: Scribble.

      AppWizard creates a project directory with this name under the main (root) directory specified in the Location box. The workspace configuration file and project makefile are based on this name, in this case, Scribble.dsw and Scribble.mak, respectively.

    • Location box: (Optional: the directory in which you want your project files stored. AppWizard creates this directory if it doesn’t exist).

    • Platforms check box: Win32.

      Clear any other entries. If your installation includes other language packages, they are represented by check boxes as potential platforms. Choosing check boxes other than Win32 might mean that options you need for Scribble are not available.

  4. Click OK.

    AppWizard creates the project directory, and the MFC AppWizard – Step 1 dialog box appears.

  5. Accept the default options in the dialog boxes for AppWizard Steps 1, 2, and 3 by clicking Next.

    By default, AppWizard generates source code that supports the multiple document interface (MDI), creating Scribble as an MDI application. Also by default, AppWizard enables ActiveX Controls support.

  6. In the MFC AppWizard – Step 4 dialog box, select the following:

    • Check the MAPI (Messaging API) support check box. MAPI support is available to users only if they have an electronic mail system.

    • Click Advanced.

      The Advanced Options dialog box appears with the Document Template Strings tab selected.

  7. Fill in Advanced Options dialog box as follows:

    • File extension box: scb

      This step is optional. AppWizard appends the extension you specify here to the names of files that the user saves with Scribble. If you do not specify an extension, users must specify their own file extensions when saving files.

    • Filter name box: Scribble Files (*.scb)

      This step is optional. In the compiled Scribble application, this string appears in the List Files of Type box in the Open and Save As dialog boxes of the File menu.

  8. Click Close.

    Default options in the Step 4 dialog box create code that supports the following features:

    • A dockable toolbar

    • A status bar

    • Printing and print preview

    • 3D controls

    The default options in the Step 5 dialog box supply comments throughout the files to indicate where you need to add your own code.

    The default settings in the Step 6 dialog box specify program file and class names. For the purposes of Scribble, you won’t modify class or filenames that AppWizard automatically generates.

  9. Click Finish in the dialog box for MFC AppWizard – Step 4.

    Note   When you follow these steps, AppWizard generates filenames that differ slightly from the sample source code files. This difference will help you distinguish between your files and the samples.

    The New Project Information dialog box appears, summarizing the settings and features AppWizard will generate when it creates your project. You might want to take a moment to examine the application type, classes, and features that AppWizard automatically provides.

  10. Click OK in the New Project Information dialog box.

    AppWizard creates all necessary files and displays the project in ClassView in the Project Workspace window. See Viewing the Starter Classes later in this lesson.

To learn more about viewing the code generated for the project, see Navigating Through Code, later in this lesson.

Project Build Information

AppWizard creates both Debug and Release versions of each project it creates, selecting the Debug version as the default. The current active project configuration is displayed in the Default Configuration drop-list on the Build toolbar. You can switch the active project to specify which configuration you want to build. See Building the Starter Application later in this lesson.