[英]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.