다음을 통해 공유


Template Files

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at 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

Files Created for Your Wizard
Custom Wizard
Creating a Custom Wizard
Designing a Wizard
Templates.inf File