是否可以自定义内置的 Visual Studio 2010 C++项目向导?
我需要制作一个与内置 C++ 向导相同的自定义 C++ 项目向导。哪种类型并不重要。它可能是控制台类型的项目。
我需要更改的只是添加自定义包含目录的路径和自定义库目录的路径。
我该怎么做?
I need to make a custom C++ project wizard that is the same as built in c++ wizard. It doesn't matter which type. It could be console type project.
What I need to change is only to add a path to custom include directory and a path to custom library directory.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你想研究一下项目模板。
http://msdn.microsoft.com/en-us/library/s365byhx.aspx
I think you want to look into project templates.
http://msdn.microsoft.com/en-us/library/s365byhx.aspx
这是编写新向导的链接
http://msdn.microsoft.com/en-us/library/7k3w6w59.aspx
我建议将这些类型的设置(例如自定义路径)存储在属性表中。 ( .props 文件。)然后您可以稍后改变主意并让此更改影响多个项目。您的向导只需将此 .props 文件添加到 .vcxproj 即可。我还更喜欢 .props 文件,因为您还可以定义 vcxproj 和其他 .props 文件可以使用的其他用户宏。
http://msdn.microsoft.com/en-us/library/a4xbdz1e.aspx
内置向导位于 [vsinstalldir]\vc\VCWizards\AppWiz 中
注册这些项目类型的其他文件位于 [vsinstalldir]\vc\VCprojects\ 中
您可以更改这些内容或复制它们以获得其余的 C++ 向导功能。
其他想法:
您可能会注意到,.vcxproj 通常具有如下所示的条目:
这意味着现有向导创建了一个尝试绑定到用户属性表(如果存在)的条目。
我推荐第二个想法。添加包含、lib 路径和其他类型的设置是常见情况,现有向导通过引用用户属性表来实现此目的。
Here is a link to writing a new wizard
http://msdn.microsoft.com/en-us/library/7k3w6w59.aspx
I recommend storing those types of settings like custom paths in a property sheet. ( .props file.) Then you can change your mind later and have this change affect multiple projects. Your wizard could simply add this .props file to the .vcxproj. I also prefer .props files because you can also define additional user macro's that the vcxproj and other .props files can use.
http://msdn.microsoft.com/en-us/library/a4xbdz1e.aspx
The built-in wizards are found in [vsinstalldir]\vc\VCWizards\AppWiz
The additional files that register these project types are found in [vsinstalldir]\vc\VCprojects\
You could alter those or copy them to get the rest of the c++ wizard functionality.
Additional Idea:
You may notice that .vcxproj's typically have an entry like this:
This means that the existing wizard made an entry that tries to bind to a user property sheet if one exists.
I recommend the second idea. Adding include, lib path, and other types of settings are a common scenario and the existing wizard allows for this by having a reference to user property sheets.