The first part AppWizard and its working principle
The AppWizard, the Application Wizard, is one of the powerful programming tools in the Visual Studio development environment, with which you can create various types of programs. such as Win32 applications, ATL, MFC applications, and so on. In Windows terminology, the Term Wizard (Wizard) refers to an application, one of the main features of which is to provide a series of dialog boxes that guide the user through the necessary choices to complete a given task. The Application Wizard in VC--appwizard provides a series of project-specific dialog boxes for programmers to define new projects of all types. Each of these dialog boxes shows some options for specifying the project type. For example, when you create a Windows DLL with AppWizard, the first dialog box lets the programmer specify what type of DLL to create, whether it is a regular type or an MFC extension type, if you want to include automation support, and do not want source code comments, and so on.
Depending on the dialog boxes populated by the programmer, AppWizard will automatically create the framework files needed to construct the project, including: Engineering files, work-room files, source code files, header files, resource files, and so on. AppWizard is one of the most used tools in the Visual Studio development environment. Still, AppWizard has its drawbacks. That is, common engineering types are built into Visual Studio and cannot create their own AppWizard. This problem has been resolved since the custom AppWizard (Visual C + + 4.0). Custom AppWizard is also customized AppWizard. Custom AppWizards is especially useful when creating a similar number of projects. For example, you create a project that is SDI and support Automation (automation), so you can create your own custom AppWizard to set SDI Automation as the default option. This can improve productivity. In addition, custom AppWizard can also be used to create a personalized project. For example, you want all projects to have a "about" dialog box, and in this dialog box to display personal information or the company's logo and other proprietary information, each source code file with its own special comments. So it's easy to implement this requirement by creating a custom AppWizard. You can even define and display your own custom dialog boxes to collect the information and options needed for engineering types. In the first part of this article, we'll discuss how AppWizard works, and then in the next section, learn how to create custom AppWizard in a step-by-step way. Eventually we will create a custom AppWizard that is very useful in practical programming. and provide full source code.
Before learning to use custom AppWizard, you must first understand how AppWizard works and how AppWizard creates projects based on different user choices.
AppWizard has a Management appliance (manager) that is not a separate application. Custom AppWizard runs in the Visual Studio framework. AppWizard's so-called "manager" is actually MFCAPWZ.DLL, which controls the execution of different AppWizard. In the dialog box where you create a new project, the Project tab is the default option, and the list box shows the built-in project type. In addition, this list box also lists the user-customized AppWizard, as shown in figure one.
Figure I
These custom AppWizard file extensions are *.awx, and they are stored in a specific directory. If you install VC6.0 with the default path, the custom AppWizard file is stored in the \program Files\Microsoft Visual Studio\common\msdev98\ after successful compilation The template folder. Note This new list item "MFC AppWizard (EXE) –VC Knowledge Base" In the list box, which is the AppWizard we want to customize later. As you can see from here, as soon as the *.awx file is generated, it will automatically appear in this list box, along with the standard (or built-in) Visual C + + AppWizard.