Home | Overviews | How Do I | Details | Sample
Feature Only in Professional and Enterprise Editions Creating a Custom AppWizard is supported only in Visual C++ Professional and Enterprise Editions. For more information, see Visual C++ Editions.
The MFC AppWizard obtains the building blocks for the code, resource, and project files it creates from special files called custom resource templates. There are two types of custom resource templates: text templates and binary templates. Text templates are used to create the source files for a project, and binary templates usually contain bitmaps for user-interface components, such as toolbars.
AppWizard always provides you with a copy of the CONFIRM.INF and NEWPROJ.INF templates and, if you use existing sequences of standard MFC AppWizard steps, AppWizard copies its own custom resource templates into your custom AppWizard project for you to use and/or modify. You can also create your own templates and add them to your custom AppWizard project.
Custom resource templates are resources of type “TEMPLATE”. You can see these if you double-click your project’s resource script file (.RC) in the Workspace window. All custom resource templates are in the folder called “TEMPLATE”. Because these are custom resources, they are treated as binary data. If you double-click a custom resource type in the Project Workspace window, the associated file opens in a binary editor. If you want to edit a custom resource, you must know the actual type it represents and choose that type from the Open As list in the Open dialog box.
To open a custom resource type in the appropriate editor
Files with the chosen extension are displayed in the File Name box.
This box serves as a filter to display all files with a given extension. For example, selecting Image Files in the Files of Type box displays all files with *.BMP, *.DIB, *.ICO, and *.CUR extensions in the File name box.
The Auto type will correctly recognize custom resource template file extensions such as .BMP, .H, and .CPP and open an associated file in the correct editor. Select Text from the Open As list to edit custom resource templates that represent resource scripts (.RC files).
To create a custom resource template
This box serves as a filter to display all files with a given extension. For example, selecting Icons in the Files of type box displays all files with *.ICO extension in the File Name box.
The file is imported into your project as a custom resource type and opened in the binary data editor.
The custom resource type is added to your project under your projects “Template” folder, which is available by selecting the ResourceView tab in the Project Workspace window. The custom resource template type is given an ID of IDR_TEMPLATE*, where * is a number that is unique within the “Template” folder. You can use the Properties command on the pop-up menu to change the ID. To activate the ID’s pop-up menu, place the mouse cursor on the new custom resource template’s ID in the “Template” window and click the right mouse button.