Create a Visual C++ Wizard for Visual Studio 2005

from:http://www.codeguru.com/cpp/v-s/devstudio_macros/customappwizards/article.php/c12775/Create-a-Visual-C-Wizard-for-Visual-Studio-2005.htm#page-1

Create a Visual C++ Wizard for Visual Studio 2005

If you often create VC++ projects that are very similar, such as DLLs that follow some guidelines or rules for common integration in an application (like a plug-in based application), you might get tired of creating a default VC++ project and then doing the same changes to it over and over again. In that case, perhaps it's time for you to write a VC++ wizard that automatically generates all that you need to start doing work.

In this article, I'll show you how to create a simple wizard for a Win32 console-based application. This project template will have several particularities:

  • Uses precompiled headers, so stdafx.h and stdafx.cpp will be generated
  • Contains files for a dummy class that the user chooses to name; the name of the files will be the same as the class. These files will be placed inside a subfolder called 'src' that will be added to the Additional Include Directories property
  • Includes comments at the beginning of each file containing the author and the date of creation
  • Includes a file called main.cpp containing the main() function that will instantiate an object of the created class
  • In addition, a readme.txt text file should be generated, but not added to the list of project files

Creating the Project

To create a new wizard project, go to File > New > Project and select Visual C++, and then from the list of available templates customwiz. Let's call this project "DummyWin32Wizard", because after all, that's exactly what it is. You will be asked to select the settings for this project. First, put "DummyWin32Wizard" in the "Wizard Friendly Name" edit, check the "User Interface" checkbox, and set the number of pages of the wizard to 1, because that's all what we'll need.

 
 

When the project is created, it will have several created files that you can see in the following picture. The most important ones are described here:

  • Default.html: The file containing the HTML code for the wizard's interface pages
  • Default.js: The file containing the JScript code called by the framework when the wizard is run
  • Default.vcproj is a VC++ project file containing the minimum information for a project, such as project type, platforms, and list of configurations
  • DummyWin32Wizard.ico: The icon associated with the template in the list of VisualC++ templates
  • DummyWin32Wizard.vsz: The start point of the wizard. Itcontains information about the wizard project, such as name, path (either absolute or relative), or LCID. This file basically names a COM component that Visual Studio can use to create an item, and lists the parameters the component receives. You can read more about the file inMSDN. Default content of the file is:
    1. VSWIZARD 7.0
    2. Wizard=VsWizard.VsWizardEngine.8.0
    3.  
    4. Param="WIZARD_NAME = DummyWin32Wizard"
    5. Param="ABSOLUTE_PATH = D:CiluVC++codeguruarticles
    6. wizardDummyWin32Wizard"
    7. Param="FALLBACK_LCID = 1033"
  • DummyWin32Wizard.vsdir: lists all the items and their properties that are displayed in the selection dialog and the corresponding .vsz file; the default content of the file is listed below:
    1. DummyWin32Wizard.vsz||DummyWin32Wizard|1|
    2. TODO:WizardDescription.||6777||DummyWin32Wizard

    The information listed in this file is:

    • DummyWin32Wizard.vsz: The relative path to the .vsz file
    • Optional GUID: A component that contains resources (not specified in the about string)
    • DummyWin32Wizard: The name of the template displayed in the list of available templates
    • 1: The sort priority for displaying the items in the list of available templates; items with lower numbers are displayed at the beginning of the list
    • TODO: Wizard Description: A string describing the wizard, shown in the status field
    • Optional GUID or path of a DLL: Contains the icon to be with the item in the list (not specified in the about string)
    • 6777: The resource ID of the icon in the component
    • Optional additional flags (not specified in the about string)
    • DummyWin32Wizard: The suggested base name for the item. A number is inserted before the extension of the item, if one exists. If DummyWin32Wizard is replaced, for instance, with <DummyWin32Wizard>, the wizard will not suggest any name and the user is forced to enter a name for the item

When you create the custom wizard project, Visual Studio automatically copies the files DummyWin32Wizard.ico, DummyWin32Wizard.vsd, and DummyWin32Wizard.vsdir in the folder VCvcprojects of the Visual Studio 8 installation folder. That means that if you go to File > New > Project and select VisualC++ you'll already be able to create a project with it.

I would suggest changing the content of the DummyWin32Wizard.vsdir file to

  1. DummyWin32Wizard.vsz||DummyWin32Wizard|1|Just a training
  2. purpose wizard||6777||<DummyWin32Wizard>

and copying it to the VCvcprojects folder, so that the templates dialog shows what you want.

Customizing the Wizard's User Interface

If you selected a user interface of one HTML page as suggested earlier, Visual Studio will add some default controls to this unique page. It is shown in the picture below:

[page1.png]

 

Base of the requirements that we decided for the template in the beginning, the settings page should allow the users to select the name of a dummy class to create and the name of the user (that generates the project). Thus, we should customize the from to look like this:

[page2.png]

This will make the wizard's settings page look like this:

[wizardpage.png]

If you want to fill in some values—for instance, the name of the author—before the page is displayed, you should put the code in the InitDocument() function.

  1. // This is an example of a function which initializes the page
  2. //
  3. functionInitDocument(document)
  4. {
  5. setDirection();
  6.  
  7. if(window.external.FindSymbol('DOCUMENT_FIRST_LOAD'))
  8. {
  9. // This function sets the default symbols based
  10. // on the values specified in the SYMBOL tags above
  11. //
  12. window.external.SetDefaults(document);
  13. }
  14.  
  15. // Load the document and initialize the controls
  16. // with the appropriate symbol values
  17. //
  18. window.external.Load(document);
  19. }

Using Template Files

In the beginning of this article, you learned that the application folder should contain the following items:

  • Src:
    • <Classname>.h
    • <Classname>.cpp
  • Stdafx.h
  • Stdafx.cpp
  • Main.cpp
  • <Projectname>.vcproj
  • Readme.txt (not added to the project file)

You will use templates to generate these files. If you look in the Templates1033 folder, you will see three files; one of them is called Templates.inf. This file contains a list of template file that will be parsed in the JScript code during the execution. In this folder, you will add the following files:

BaseSample.cpp

  1. /************************************************
  2. * Author: [!output AUTHOR_NAME]
  3. * Date: [!output CURRENT_DATE]
  4. ************************************************/
  5.  
  6. #include"stdafx.h"
  7. #include"[!output CLASS_NAME].h"
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])
  10. {
  11. [!output CLASS_NAME]* sample =new[!output CLASS_NAME];
  12.  
  13. // do the stuff here
  14.  
  15. delete sample;
  16.  
  17. return0;
  18. }

SampleClass.h

  1. /************************************************
  2. * Author: [!output AUTHOR_NAME]
  3. * Date: [!output CURRENT_DATE]
  4. ************************************************/
  5.  
  6. #pragma once
  7.  
  8. class[!output CLASS_NAME]
  9. {
  10. public:
  11. [!output CLASS_NAME](void);
  12. ~[!output CLASS_NAME](void);
  13. };

SampleClass.cpp

  1. /************************************************
  2. * Author: [!output AUTHOR_NAME]
  3. * Date: [!output CURRENT_DATE]
  4. ************************************************/
  5.  
  6. #include"StdAfx.h"
  7. #include"[!output CLASS_NAME].h"
  8.  
  9. [!output CLASS_NAME]::[!output CLASS_NAME](void)
  10. {
  11. }
  12.  
  13. [!output CLASS_NAME]::~[!output CLASS_NAME](void)
  14. {
  15. }

Stdafx.h

  1. /************************************************
  2. * Author: [!output AUTHOR_NAME]
  3. * Date: [!output CURRENT_DATE]
  4. ************************************************/
  5.  
  6. #pragma once
  7.  
  8. #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from
  9. // Windows headers
  10. #include<stdio.h>
  11. #include<tchar.h>

Stdafx.cpp

  1. /************************************************
  2. * Author: [!output AUTHOR_NAME]
  3. * Date: [!output CURRENT_DATE]
  4. ************************************************/
  5.  
  6. #include"stdafx.h"
  7.  
  8. // TODO: reference any additional headers you need in STDAFX.H
  9. // and not in this file

Readme.txt

  1. ==================================================================
  2. CONSOLE APPLICATION :[!output PROJECT_NAME]ProjectOverview
  3. ==================================================================

Then, you will modify the content of the Templates.inf file to list all of them:

  1. BaseSample.cpp
  2. sampleclass.cpp
  3. sampleclass.h
  4. stdafx.cpp
  5. stdafx.h
  6. ReadMe.txt

You can see several tags in these files: [!output AUTHOR_NAME][!output CURRENT_DATE], and [!output CLASS_NAME]. Visual Studio will replace these tags with the value of the symbols AUTHOR_NAME, CURRENT_DATE, and CLASS_NAME. So, if the name of the author is Marius Bancila, the date is 2006.10.17, and the class name Foo, then the sampleclass.h file would be generated like this:

  1. /************************************************
  2. * Author: Marius Bancila
  3. * Date: 2006.10.17
  4. ************************************************/
  5.  
  6. #pragma once
  7.  
  8. classFoo
  9. {
  10. public:
  11. Foo(void);
  12. ~Foo(void);
  13. };

The complete list of template directives is provided in MSDN.

Writing the JScript

When the user clicks the Finish button, the wizard loads the default.js file into the Script Files folder in Solution Explorer. The file contains by default the following functions:

  • OnFinish: Called by the wizard when the Finish button is clicked; it adds files and filters, render templates and creates the configurations
  • CreateCustomProject: Creates the project at the specified location when the Finish button is pressed
  • AddFilters: Adds filters to the project
  • AddConfig: Adds configurations to the project
  • PchSettings: Sets the precompiled header settings
  • DelFile: Deletes the specified files
  • CreateCustomInfFile: Creates the project's Templates.inf file
  • GetTargetName: Gets the name of a specified file
  • AddFilesToCustomProj: Adds specified files to the project

In addition to these functions, you can add your own JScript function to Default.js. To access properties and methods in the wizard object model or the environment model from the JScript file, prepend the object model item with wizard and respective date.

OnFinish

 This function is called when the Finish button in the dialog is pressed. This function calls most of the other functions mentioned above. In addition to the default provided code, you need to do three things:

  • Generate a symbol with the value of the current date to write in the files header
  • Add a symbol for each filter to add to the project
  • Call AddCommonConfig function to add the default Debug and Release configurations to the project

The code of the function is shown below:

  1. functionOnFinish(selProj, selObj)
  2. {
  3. try
  4. {
  5. var strProjectPath = wizard.FindSymbol('PROJECT_PATH');
  6. var strProjectName = wizard.FindSymbol('PROJECT_NAME');
  7.  
  8. // get the current date and add a symbol CURRENT_DATE
  9. var currentTime =newDate();
  10. var month = currentTime.getMonth()+1
  11. var day = currentTime.getDate();
  12. var year = currentTime.getFullYear();
  13. var today = year +'.'+ month +'.'+ day;
  14. wizard.AddSymbol('CURRENT_DATE', today);
  15.  
  16. // add symbols for the filters of the project
  17. wizard.AddSymbol('MY_SOURCE_FOLDER_NAME','Source Files');
  18. wizard.AddSymbol('MY_HEADER_FOLDER_NAME','Header Files');
  19. wizard.AddSymbol('MY_RESOURCE_FOLDER_NAME','Resource Files');
  20.  
  21. selProj =CreateCustomProject(strProjectName, strProjectPath);
  22. AddCommonConfig(selProj, strProjectName);
  23. AddConfig(selProj, strProjectName);
  24. AddFilters(selProj);
  25.  
  26. varInfFile=CreateCustomInfFile();
  27. AddFilesToCustomProj(selProj, strProjectName, strProjectPath,
  28. InfFile);
  29. PchSettings(selProj);
  30. InfFile.Delete();
  31.  
  32. selProj.Object.Save();
  33. }
  34. catch(e)
  35. {
  36. if(e.description.length !=0)
  37. SetErrorInfo(e);
  38. return e.number
  39. }
  40. }

AddFilters

This function is called to create the filters for the project. Your project will have three filters:

  • Source Files: Contains files with the extensions .cpp, .cxx, .c
  • Header Files: Contains files with the extensions .h, .hpp
  • Resource Files: Contains files with the extensions .rc, .rc2, .bmp, .ico, .gif

In this function, you will retrieve the values of the symbols generated in OnFinish() to use as the filter names.

  1. functionAddFilters(proj)
  2. {
  3. try
  4. {
  5. var group1 = proj.Object.AddFilter
  6. (wizard.FindSymbol('MY_SOURCE_FOLDER_NAME'));
  7. group1.Filter=".cpp;.cxx;.c";
  8.  
  9. var group2 = proj.Object.AddFilter
  10. (wizard.FindSymbol('MY_HEADER_FOLDER_NAME'));
  11. group2.Filter=".h;.hpp";
  12.  
  13. var group3 = proj.Object.AddFilter
  14. (wizard.FindSymbol('MY_RESOURCE_FOLDER_NAME'));
  15. group3.Filter='.rc;.rc2;.ico;.gif;.bmp;';
  16. }
  17. catch(e)
  18. {
  19. throw e;
  20. }
  21. }

AddConfig

Use this function to set the various compiler and linker settings for the available configurations. You can access the configuration object in this manner:

  1. var config = proj.Object.Configurations('Debug');

The members of the VCConfiguration interface are listed here. You can set properties such as the IntermediateDirectory, OutputDirectory, or ConfigurationType. An important property is Tools that gives the available tools for the configuration that include:

In the sample code, the compiler, linker, manifest, and browser tools are customized with different settings. The code is listed below:

  1. functionAddConfig(proj, strProjectName)
  2. {
  3. try
  4. {
  5. // ----------------------------------------------------------
  6. // settings for the DEBUG configuration
  7. // ----------------------------------------------------------
  8. var config = proj.Object.Configurations('Debug');
  9. config.IntermediateDirectory='.\Debug';
  10. config.OutputDirectory='.\Debug';
  11. config.InheritedPropertySheets=
  12. '$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops';
  13. config.ConfigurationType=ConfigurationTypes.typeApplication;
  14.  
  15. varCLTool= config.Tools('VCCLCompilerTool');
  16. CLTool.AdditionalIncludeDirectories='./;./src/';
  17. CLTool.Detect64BitPortabilityProblems=false;
  18. CLTool.PreprocessorDefinitions='WIN32;_DEBUG;_CONSOLE';
  19. CLTool.UsePrecompiledHeader= pchOption.pchCreateUsingSpecific;
  20. CLTool.PrecompiledHeaderThrough="StdAfx.h";
  21. CLTool.PrecompiledHeaderFile='.\Debug/'+
  22. strProjectName +'.pch';
  23. CLTool.AssemblerListingLocation='.\Debug/';
  24. CLTool.ObjectFile='.\Debug/';
  25. CLTool.ProgramDataBaseFileName='.\Debug/';
  26.  
  27. varLinkTool= config.Tools('VCLinkerTool');
  28. LinkTool.OutputFile='$(OutDir)$(ProjectName).exe';
  29. LinkTool.GenerateManifest=false;
  30. LinkTool.ProgramDatabaseFile='.\Debug/'+
  31. strProjectName +'D.pdb';
  32. LinkTool.SubSystem= subSystemOption.subSystemNotSet;
  33. LinkTool.ImportLibrary='.\Debug/'+ strProjectName +'D.lib';
  34.  
  35. varManifestTool= config.Tools('VCManifestTool');
  36. ManifestTool.EmbedManifest=false;
  37. ManifestTool.OutputManifestFile='$(TargetPath).manifest';
  38.  
  39. varBrowseTool= config.Tools('VCBscMakeTool');
  40. BrowseTool.OutputFile='.\Debug/'+ strProjectName +'D.bsc';
  41.  
  42. // ----------------------------------------------------------
  43. // settings for the RELEASE configuration
  44. // ----------------------------------------------------------
  45. config = proj.Object.Configurations('Release');
  46. config.IntermediateDirectory='.\Release';
  47. config.OutputDirectory='.\Release';
  48. config.InheritedPropertySheets=
  49. '$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops';
  50. config.ConfigurationType=ConfigurationTypes.typeApplication;
  51.  
  52. varCLTool= config.Tools('VCCLCompilerTool');
  53. CLTool.AdditionalIncludeDirectories='./;./src/';
  54. CLTool.DebugInformationFormat= debugOption.debugDisabled;
  55. CLTool.Detect64BitPortabilityProblems=false;
  56. CLTool.InlineFunctionExpansion= expandOnlyInline;
  57. CLTool.WholeProgramOptimization=false;
  58. CLTool.PreprocessorDefinitions='WIN32;NDEBUG;_CONSOLE';
  59. CLTool.StringPooling=true;
  60. CLTool.EnableFunctionLevelLinking=true;
  61. CLTool.UsePrecompiledHeader= pchOption.pchCreateUsingSpecific;
  62. CLTool.PrecompiledHeaderThrough="StdAfx.h";
  63. CLTool.PrecompiledHeaderFile='.\Release/'+
  64. strProjectName +'.pch';
  65. CLTool.AssemblerListingLocation='.\Release/';
  66. CLTool.ObjectFile='.\Release/';
  67. CLTool.ProgramDataBaseFileName='.\Release/';
  68.  
  69. varLinkTool= config.Tools('VCLinkerTool');
  70. LinkTool.OutputFile='$(OutDir)$(ProjectName).exe';
  71. LinkTool.GenerateManifest=false;
  72. LinkTool.GenerateDebugInformation=false;
  73. LinkTool.ProgramDatabaseFile='.\Release/'+
  74. strProjectName +'.pdb';
  75. LinkTool.SubSystem= subSystemOption.subSystemNotSet;
  76. LinkTool.OptimizeReferences=
  77. optRefType.optReferencesDefault;
  78. LinkTool.EnableCOMDATFolding=
  79. optFoldingType.optFoldingDefault;
  80. LinkTool.LinkTimeCodeGeneration=
  81. LinkTimeCodeGenerationOption.
  82. LinkTimeCodeGenerationOptionDefault;
  83.  
  84. varManifestTool= config.Tools('VCManifestTool');
  85. ManifestTool.EmbedManifest=false;
  86. ManifestTool.OutputManifestFile='$(TargetPath).manifest';
  87.  
  88. varBrowseTool= config.Tools('VCBscMakeTool');
  89. BrowseTool.OutputFile='.\Release/'+
  90. strProjectName +'D.bsc';
  91. }
  92. catch(e)
  93. {
  94. throw e;
  95. }
  96. }

GetTargetName

This function gets called for every file listed in the Templates.inf file. You can use this method to change the name of the files or the path. That is exactly what we need to do to follow the requirements:

  • Sampleclass.h must be renamed to <CLASS_NAME>.h and put in the src subfolder
  • Sampleclass.cpp must be renamed to <CLASS_NAME>.h and put in the src subfolder
  • BaseSample.cpp must be renamed to main.cpp

All the other file names remain unchanged and they will be placed in the directly under the project folder.

  1. functionGetTargetName(strName, strProjectName)
  2. {
  3. try
  4. {
  5. var strTarget = strName;
  6. // get the name of the class
  7. var strClassName = wizard.FindSymbol('CLASS_NAME');
  8.  
  9. if(strName =='sampleclass.h')
  10. {
  11. strTarget ='src\'+ strClassName +'.h';
  12. }
  13. elseif(strName =='sampleclass.cpp')
  14. {
  15. strTarget ='src\'+ strClassName +'.cpp';
  16. }
  17. elseif(strName =='BaseSample.cpp')
  18. strTarget ='main.cpp';
  19.  
  20. return strTarget;
  21. }
  22. catch(e)
  23. {
  24. throw e;
  25. }
  26. }

AddFilesToCustomProj

This function parses the templates file and adds files to the project. For each file name, it calls GetTargetName() to get the name (and relative path) of the file in the project. In the templates, one of the files is ReadMe.txt, but you don't want this file to be added to the project file, only to be degenerated in the project folder. A custom function called KeepOutsideProject() takes the name of each file (the same name passed to GetTargetName, and not the name returned by this function) and returns true if the file should not be listed in the project file.

  1. functionKeepOutsideProject(strName)
  2. {
  3. try
  4. {
  5. var add =false;
  6.  
  7. if(strName =='ReadMe.txt')
  8. add =true;
  9.  
  10. return add;
  11. }
  12. catch(e)
  13. {
  14. throw e;
  15. }
  16. }

Once a file is generated in the project folder, it is added to the project to one of the available filters, depending of the extension. Complete source code is listed below:

  1. functionAddFilesToCustomProj(proj, strProjectName, strProjectPath,
  2. InfFile)
  3. {
  4. try
  5. {
  6. var projItems = proj.ProjectItems
  7.  
  8. // get references to the filters of the project
  9. var projFilters = proj.Object.Filters;
  10. var filterSrc =
  11. projFilters.Item(wizard.FindSymbol('MY_SOURCE_FOLDER_NAME'));
  12. var filterHdr =
  13. projFilters.Item(wizard.FindSymbol('MY_HEADER_FOLDER_NAME'));
  14. var filterRc =
  15. projFilters.Item(wizard.FindSymbol('MY_RESOURCE_FOLDER_NAME'));
  16.  
  17. var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH');
  18.  
  19. var strTpl ='';
  20. var strName ='';
  21.  
  22. var strTextStream =InfFile.OpenAsTextStream(1,-2);
  23. while(!strTextStream.AtEndOfStream)
  24. {
  25. strTpl = strTextStream.ReadLine();
  26. if(strTpl !='')
  27. {
  28. strName = strTpl;
  29. var strTarget =GetTargetName(strName, strProjectName);
  30. var strTemplate = strTemplatePath +'\'+ strTpl;
  31. var strFile = strProjectPath +'\'+ strTarget;
  32.  
  33. var bCopyOnly =false;
  34. var strExt = strName.substr(strName.lastIndexOf("."));
  35. if(strExt==".bmp"|| strExt==".ico"|| strExt==".gif"||
  36. strExt==".rtf"|| strExt==".css")
  37. bCopyOnly =true;
  38. wizard.RenderTemplate(strTemplate, strFile, bCopyOnly);
  39.  
  40. if(!KeepOutsideProject(strName))
  41. {
  42. if(strExt =='.cpp'|| strExt =='.cxx'||
  43. strExt =='.c')
  44. {
  45. filterSrc.AddFile(strTarget);
  46. }
  47. elseif(strExt =='.hpp'|| strExt =='.h')
  48. {
  49. filterHdr.AddFile(strTarget);
  50. }
  51. elseif(strExt =='.rc2'||
  52. strExt =='.ico'|| strExt =='.gif'||
  53. strExt =='.bmp')
  54. {
  55. filterRc.AddFile(strTarget);
  56. }
  57. elseif(strExt =='.rc')
  58. {
  59. filterRc.AddFile(strFile);
  60. }
  61. else
  62. proj.Object.AddFile(strFile);
  63. }
  64. }
  65. }
  66. strTextStream.Close();
  67. }
  68. catch(e)
  69. {
  70. throw e;
  71. }
  72. }

All the other functions in Default.js should remain unmodified for this sample project.

Deploying the VC++ Wizard

If you followed all the indications I have given in this article so far, the DummyWin32Wizard is completed. Because Visual Studio has copied the necessary entry files in its default folder for wizards, you now can create projects using it, wherever the project is located on your computer. However, I suggest you deploy it in the same location with the other VisualC++ templates. There are two folders:

  • {VS2005InstallationFolder}VCVCWizards: Hosts the wizard projects; you should deploy the wizard project in the AppWiz subfolder, either by simply copying the project here, or using an installation project (if you want to deploy it on more machines, not just yours);
  • {VS2005InstallationFolder}VCVCProjects: You have to deploy three files here (remember that on your machine you should already have these files in place):
    • DummyWin32Wizard.ico
    • DummyWin32Wizard.vsdir
    • DummyWin32Wizard.vsz

If you deploy the files here, you should change the path parameter in the DummyWin32Wizard.vsz file. The content of the file should change from:

  1. VSWIZARD 7.0
  2. Wizard=VsWizard.VsWizardEngine.8.0
  3.  
  4. Param="WIZARD_NAME = DummyWin32Wizard"
  5. Param="ABSOLUTE_PATH =
  6. D:CiluVC++codeguruarticleswizardDummyWin32Wizard"
  7. Param="FALLBACK_LCID = 1033" 
  1. VSWIZARD 7.0
  2. Wizard=VsWizard.VsWizardEngine.8.0
  3.  
  4. Param="WIZARD_NAME = DummyWin32Wizard"
  5. Param="RELATIVE_PATH = VCWizardsAppWiz"
  6. Param="FALLBACK_LCID = 1033"

Using DummyWin32Wizard

Having done that, your VC++ wizard is set in place and you can use it just like all the others wizards: go to File > New > Project, select the VisualC++ category, and then Dummy Win32 Wizard item in the templates list. When you select it, the wizard's settings page is shown:

[wizardpage.png]

If you generate a project called DummyTest and fill in Foo for the name class, and an author name, the generated files for the project are shown below:

[solution2.png]

原文地址:https://www.cnblogs.com/zhuzhu_/p/3272804.html