简体   繁体   中英

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; and currently all icons appear as placeholders. There are properties that Visual Studio requests that allow me to define the icons ( _VSHPROPID Enumeration )

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

In the MPF sample from Microsoft; they return the same values as me (null) for the above properties, yet the default icons (eg. .cs) appear correctly!

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

That's how MPF and some others do it, anyway. I was unable to make it work, so I'm giving up!

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM