模板文件

更新:2007 年 11 月

组成向导的模板是文本文件的集合,这些文本文件包含某些简单指令,并根据用户输入分析、呈现和添加到初始项目中。获取用于分析模板的适当信息的方法是直接访问向导控件的符号表。

下面的示例是一个很简单的向导模板文件,它询问用户是选择 A 还是选择 B。

示例

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:

如果用户选择 Type B,则上面的模板将呈现为:

输出

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

注意   上面的语法是 Visual C++ .NET 中的新内容。Visual C++ .NET 不支持 Visual C++ 早期版本中的语法。

请参见

任务

创建自定义向导

概念

为向导创建的文件

设计向导

Templates.inf 文件

参考

自定义向导