Delen via


Template Files

The templates that make up a wizard are a collection of text files that contain some simple directives and are parsed and rendered according to user input and added to the initial project. The appropriate information for parsing the templates is obtained by directly accessing the wizard control's symbol table.

The following example is a very simple template file for a wizard that asks the user to select either A or B.

Example

This file has been created by My Custom wizard.
You selected:
[!if TYPE_A]
Type A
[!else]
Type B
[!endif]
The name of this project is [!output PROJECT_NAME].root.cpp:

If the user chooses Type B, the above template would be rendered as follows:

This file has been created by My Custom wizard.
You selected:
Type B
The name of this project is MyApp8.

Output

This file has been created by My Custom wizard.
You selected:
Type B
The name of this project is MyApp8.

Note The syntax above is new to Visual C++ .NET. Syntax from previous versions of Visual C++ is not supported in Visual C++ .NET.

See Also

Tasks

Creating a Custom Wizard

Reference

Custom Wizard

Concepts

Files Created for Your Wizard

Designing a Wizard

Templates.inf File