创建“添加新项向导";在Visual C ++中 [英] Create "Add New Item Wizard" in Visual C++

查看:119
本文介绍了创建“添加新项向导";在Visual C ++中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我没有使用正确的关键字搜索,但是我找不到有关如何在Visual Studio Community 2013中为C ++项目制作自己的添加新项向导"的文档.

Maybe I'm not searching with the right keywords, but I'm unable to find documentation on how to make your own "Add New Item Wizard" in Visual Studio Community 2013 for C++ projects.

我想要实现的是能够从Project > Add New Item...向我的C ++项目中添加新的无扩展名源文件,而不是添加C ++源文件并随后在解决方案资源管理器中删除.cpp扩展名.

What I want to achieve is to be able to add new extensionless source files to my C++ projects from Project > Add New Item... instead of adding a C++ Source File and deleting the .cpp extension in the Solution Explorer afterwards.

首先,我尝试制作自己的模板,但事实证明,这对于Visual Studio中的C ++项目是不可能的. 其次,我尝试查看是否可以修改默认模板之一( Stack Overflow post ),但这也是不可能的.

First I tried to make my own template, but it turns out, that that is not possible with C++ Projects in Visual Studio. Second I tried to see if I can modify one of the default templates (Stack Overflow post), but that is also not possible.

我正在阅读此文档: MSDN:演练:创建向导,但我只能找到有关如何制作新项目向导"而不是添加新项目向导"的说明.

I'm reading this documentation: MSDN: Walkthrough: Creating a Wizard, but I can only find instructions on how to make a "New Project Wizard" and not an "Add New Item Wizard".

我在这里想念什么?

推荐答案

好吧,看来我特别想做的事情的解决方案毕竟很简单:

Well, it seems that the solution for what I specifically wanted to do was quite simple after all:

不是导出并添加项目模板"(该功能在VS的最新版本中不适用于C ++项目),而是修改默认的项目模板,或尝试制作自己的向导,而不是;您可以转到:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcprojectitems并在其中复制您的自定义模板文件.您还应该手动修改该目录中的.vsdir文件,以进行进一步的自定义.我使用了此参考来指定图标并更改排序顺序.

Instead of exporting and adding an "Item Template" (a feature that in the last version of VS does not work for C++ projects) or modifying the default item templates, or trying to make my own Wizard; You can just go to: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcprojectitems and copy your custom template files there. You should also modify the .vsdir files in that directory by hand for further customization. I used this reference to specify an icon and change the sorting order.

效果不像Visual Studio的C#或VB部分那样,您可以使用导出向导"将新的项目和项目模板添加到相应的对话框中,并将它们存储在template文件夹中.我将给VS团队写一些反馈,希望他们能在下一版本中解决此问题.

It's not so nice like in the C# or VB parts of Visual Studio where you can just use the Export Wizard to add new project and item templates to the corresponding dialogs and have them stored in your templates folder. I will write some feedback to the VS team and hope they fix this in the next version.

这篇关于创建“添加新项向导";在Visual C ++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆