In my post Setting Up Visual Studio 10 For MASM32 Programming, we saw how to configure Visual Studio 2010 for masm programming. In this article I will show you the process of creating a project wizard for a masm console application. A project wizard is similar to a regular project template; however, the export to template does not allow for exporting and use of a C++ application. Since a C++ template was the basis for masm_demo we will be using a C++ Custom Wizard template to create our new masm wizard. Let’s see how this is done.
- Create a new C++ Custom Wizard
- Uncheck user interface check box since we will not be displaying any screens.
- This step will require that you complete Setting Up Visual Studio 10 For MASM32 Programming successfully. If you have then, open the masm_demo project in your favourite editor. Copy the contents of that file and use it to replace the contents of the default.vcproj in your wizard.
- Copy the source.asm from masm_demo project and paste it into Templates\1033\ folder of your wizard project.
- Delete the .txt from your wizard project and add the source.asm file from Templates\1033\.
- Replace contents of Templates.inf and add source.asm
- Navigate to “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\VCWizards” then add a folder named “Macro Assembler”
- Replace all references to to the .txt file in default.js with “source.asm”
- Replace contents of Macro Assembler.vsz file with
VSWIZARD 7.0 Wizard=VsWizard.VsWizardEngine.10.0 Param="WIZARD_NAME = Macro Assembler" Param="ABSOLUTE_PATH = C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\VCWizards\Macro Assembler" Param="FALLBACK_LCID = 1033" Param="WIZARD_UI = FALSE" Param="SOURCE_FILTER = asm" Param="PROJECT_TEMPLATE_PATH = C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\VCWizards\Macro Assembler"
- Replace .vsdir and .vsz files in C:\Users\[username]\Documents\Visual Studio 2010\Wizards with the ones from Macro Assembler project directory.
- Copy contents of Macro Assembler project directory and paste it into directory created at step 7
- Done now when you run visual studio you should see a new entry under Wizards thats says Macro Assembler. If you double click on that you will get a default masm project already set up for coding. Enjoy!