Create “Add New Item Wizard” in Visual C++

匿名 (未验证) 提交于 2019-12-03 10:24:21

问题:

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.

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.

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.

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".

What I am missing here?

回答1:

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

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.

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!