简体   繁体   English

如何在不使用MPF的情况下在自定义项目类型中获得Visual Studio默认图标?

[英]How do I get Visual Studio default icons in a custom project type without using MPF?

I'm creating a custom project type in Visual Studio; 我在Visual Studio中创建一个自定义项目类型; and currently all icons appear as placeholders. 当前所有图标都显示为占位符。 There are properties that Visual Studio requests that allow me to define the icons ( _VSHPROPID Enumeration ) Visual Studio请求了一些属性,这些属性允许我定义图标( _VSHPROPID Enumeration

__VSHPROPID.VSHPROPID_IconImgList:
__VSHPROPID.VSHPROPID_IconHandle:
__VSHPROPID.VSHPROPID_IconIndex:

In the MPF sample from Microsoft; 在Microsoft的MPF示例中; they return the same values as me (null) for the above properties, yet the default icons (eg. .cs) appear correctly! 它们为上述属性返回与我相同的值(空),但是默认图标(例如.cs)正确显示!

I've spent many hours trying to strip MPF down (it's enourmous; with many tens of thousands of lines of code) but it either continues to work; 我花了很多时间试图精简MPF(这很令人惊奇;有成千上万的代码行),但是它要么继续工作,要么继续工作。 or I remove something that causes it to fail to create the new project without a useful error/stack. 或者我删除了一些导致它无法创建新项目而没有有用错误/堆栈的东西。

It seems that in addition to implemented IVsHierarchy , you need to implement the GetAutomationObjects and return ProjectItem s too. 似乎除了实现IVsHierarchy ,您还需要实现GetAutomationObjects并返回ProjectItem

That's how MPF and some others do it, anyway. 无论如何,MPF和其他一些人就是这样做的。 I was unable to make it work, so I'm giving up! 我无法使其正常运行,所以我放弃了!

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio 2013中使用自定义编译器(makefile项目)如何获取VS来解析警告 - In Visual Studio 2013 using a custom compiler (makefile project) how do I get VS to parse the warnings 如何将自定义默认构建操作与Visual Studio中的自定义文件类型相关联? - How do I associate a custom default build action to a custom file type in Visual Studio? 如何将自定义文本文件添加到visual studio项目? - How do I add a custom text file to a visual studio project? 在 Visual Studio 中,如何在不构建项目的情况下调试项目 - In Visual Studio, how do I debug a project without building it 如何在Visual Studio中获得通往另一个项目的路径? - How Do I Get The Path To Another Project In Visual Studio? 我可以更改 Visual Studio 项目类型中默认文件的内容吗? - Can I change the content of default files in a Visual Studio project type? 如何提取visual studio项目模板图标? - How to extract visual studio project template icons? 如何在没有默认 DLL 文件的情况下编译 C# Visual Studio 项目? - How can I compile a C# visual studio project without the default DLL file? 如何在不使用 Visual Studio 的情况下运行程序 - How do i run a program without using visual studio 如何确定在Powershell的Visual Studio程序包管理器控制台中选择的默认项目? - How do I determine the default project selected in the Visual Studio Package Manager Console in Powershell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM