How to Create a Custom AppWizard Project
You use the standard MFC AppWizard and the build tools to create a custom AppWizard. You can create custom AppWizards based on one of the three categories: an existing project, the standard MFC AppWizard steps, or your own custom steps. These are described below.
An Existing Project
By choosing this category, you can leverage code from a workspace that contains a single existing project. The project’s files must have originally been created by the standard MFC AppWizard, and the names of the existing project’s files and classes (CYourAppView, CYourAppDoc, etc.) should be those generated by the MFC AppWizard.
The existing project’s name must not contain nonalphanumeric characters, such as DBCS characters. The existing files, originally created from the standard MFC AppWizard, can include minor changes or additions, but major changes can introduce flaws into your new custom AppWizard.
If the base class’s default, MFC AppWizard-provided class, and/or filenames have been modified, Custom AppWizard cannot convert them to macro form as it adds them to the text templates that it generates. This is also true if you use ClassWizard to add classes to a default MFC AppWizard project. Custom AppWizard will still parse the modified names and add them to the templates, and your custom AppWizard will generate an application, but your custom AppWizard will not be able to modify the names based on the project name provided by your custom AppWizard’s user. You can work around this by adding the appropriate macros to the names in the text templates. For more information on text templates, see Understanding Text Templates. For more information on macros, see How Macros Get Their Values.
You may find it useful to examine the Custmwz.awx source code, found in the Microsoft Visual Studio\Common\msdev98\bin\ide directory that is included as a sample program.
Standard AppWizard Steps
By choosing this category, you can use one of the existing sequences of the standard MFC AppWizard steps that create an executable file or a DLL. You can use the MFC AppWizard steps by themselves, or add your own custom steps to them.
Note You can’t connect your own custom AppWizard code with existing MFC AppWizard dialog templates. For example, if your custom AppWizard uses the standard ActiveX options page, AppWizard will use its own ActiveX options step dialog template and dialog class; you cannot modify the AppWizard dialog template or class.
Your Own Custom Steps
By choosing this category, you can create a custom AppWizard that presents a completely new set of custom steps to the user.
Creating a Custom AppWizard
The procedures below list the steps necessary to create a custom AppWizard based on any of the three categories: an existing project, the standard AppWizard steps, or your own custom steps. The first procedure describes how to use the Custom AppWizard project type to create a custom AppWizard.
To create a custom AppWizard
On the File menu, click New and then click the Projects tab.
Specify the Project Name, Location, Workspace, Dependency, and Platforms options and then double-click the Custom AppWizard icon.
The name that you specify in the Name text box is used to derive the default names for the CCustomAppWiz class and its files.
To specify a custom AppWizard type, name, and number of steps
From Custom AppWizard Step 1 of 2, select a custom AppWizard category:
An existing project
Select this option if you want your custom AppWizard to generate code, resource, and project files that are based on those found in a workspace that contains a single existing project. For more information on this option, see How to Create a Custom AppWizard Project.
If you select this option, the AppWizard title bar displays “Step 1 of 2.” The text box for specifying the number of custom steps is grayed out because the features of the resulting custom AppWizard project are defined by the features of the existing project; you will not need to provide any custom AppWizard steps.
Standard AppWizard steps
Select this option if you want your custom AppWizard to use an existing sequence of AppWizard steps. For more information on this option, see How to Create a Custom AppWizard Project.
Your own custom steps
Choose this option if you want to create an entirely new custom AppWizard.
Type a name for your custom AppWizard.
If you have chosen to base your custom AppWizard on either the standard MFC AppWizard steps or a completely custom set of steps, specify the required number of custom steps.
Note If your project is based on the standard MFC AppWizard steps, type a number only if you plan to create steps other than the standard ones.
For each step that you specify, MFCAPWZ.DLL will provide a resource template that you can edit in the dialog editor, and a CAppWizStepDlg class derived from the MFC library’s CDialog class.
To specify the location of an existing project
If you’ve chosen to base your custom AppWizard on an existing project, you must specify the location of the existing project:
From Custom AppWizard Step 1 of 2, click Next.
In Step 2 of 2, type or use Browse to find the path that contains the existing project on which your custom AppWizard will be based.
To choose the type of standard MFC AppWizard steps
From Custom AppWizard Step 2 of 2, select either AppWizard Executable or AppWizard Dynamic Link Library.
Select the languages that your custom AppWizard will support.
The list box contains a language name for each language DLL in your Microsoft Visual Studio\Common\msdev98\bin\ide directory. The names of these DLLs take the form APPWZ*.DLL. For example, if Microsoft Visual Studio\Common\msdev98\bin\ide contains APPWZENU.DLL and APPWZDEU.DLL, the list box will list both English and German.
For each language you select from the list box, AppWizard will copy language-specific versions of the standard MFC AppWizard resource templates from the associated language DLL to your custom AppWizard project’s template directory. Then, after your finished custom AppWizard is copied to a custom AppWizard user’s Microsoft Visual Studio\Common\msdev98\Template directory, the custom AppWizard user can use your custom AppWizard to generate projects that support any of the languages you select.
Note The language DLLs (such as APPWZENU.DLL and APPWZDEU.DLL) contain only standard AppWizard resource templates. You must supply any nonstandard resource templates required by applications that your custom AppWizard creates. For a complete list of the standard AppWizard resource templates, see Standard Custom Resource Templates.