Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Creating a Custom AppWizard

Creating a new custom AppWizard project involves the following basic steps:

  1. Create a new custom AppWizard project with Application Wizard.
  2. Modify and/or add new template files to your custom AppWizard project.
  3. Create the dialog boxes for the steps of your AppWizard.
  4. Add any other custom modifications to the AppWizard code.
  5. Build the custom AppWizard project.
  6. Start creating applications with your new AppWizard.

This process enables you to spend as little or as much effort as you want, depending on the level of customization you want to add to your new AppWizard.

Starting a New AppWizard Project

To begin a new custom AppWizard project, choose File | New in Developer Studio.

On the Projects tab of the New dialog box, assign a project name and a location for the new project. You also can choose to create a new workspace for the project or add the project to an existing workspace. Then select Custom AppWizard from the list on the left and click OK. The custom AppWizard appears, presenting you with some options for your new AppWizard project.

In the dialog box for step 1, you can choose the name of your AppWizard as it will appear in the New Project dialog box, as well as the number of custom steps you want to add.

The most important part of this dialog box is choosing a starting point for your new AppWizard. You may choose to create your new AppWizard based on an existing project, based on a standard MFC AppWizard, or from scratch, by implementing your own custom steps.

Creating an AppWizard from an Existing Project

The first option you have is to create a new AppWizard from an existing project. This option takes an existing project that you already have set up and creates an AppWizard project that will generate projects identical to the existing project you selected. The difference is that your project will be given the name you assigned in the New Project dialog box. This name also is inserted into other appropriate places in the project created by this AppWizard, such as filenames and the names of the classes that are generated.

If you choose this option, you can build your AppWizard project without any further modification, although you also can make additional changes. Building your new AppWizard project as-is creates a new AppWizard and automatically adds it to the available choices in the New Project dialog box. You then can use this wizard to create new projects based on the original project you used to create your AppWizard.

Creating an AppWizard from a Standard MFC AppWizard

The second option is to create a custom AppWizard using the standard MFC AppWizard steps. This option enables you to use one of the standard MFC AppWizards as a starting point for your custom AppWizard. This option creates a new project for a custom AppWizard that is identical to the standard MFC AppWizard (other than the fact that it has a different name in the New Project dialog box). You can choose to leave the project as-is, but you probably will want to customize it a bit, as you will see later.

When you choose to create a custom AppWizard based on the MFC AppWizard, you also can choose to add your own custom steps to the wizard. At this point, you should enter the number of custom steps you intend to add; this creates the skeleton for your custom steps. You will look at implementing custom steps later in this chapter in the section "Creating Step Dialog Boxes."

If you choose this option, you should click Next to move on to step 2. In this dialog box, you can choose to base your new custom AppWizard on either the standard MFC executable AppWizard or the standard MFC DLL AppWizard. You also can select which languages your custom AppWizard will support. This choice will affect how certain resources are created by your new wizard, as you will see later.

Creating a Custom AppWizard with Your Own Custom Steps

The third option is to create a custom AppWizard project using your own custom steps. This option creates a bare-bones framework for your AppWizard project, but you will need to add all of the meat yourself. You will look at this process in the next sections.

Share ThisShare This

Informit Network