访问“嵌入互操作类型”以编程方式引用项目的属性
我正在为 Visual Studio 编写一个插件,我能够查看项目的所有引用的所有属性,除了一个属性。
如何以编程方式访问引用的“嵌入互操作类型”属性?
现在我正在使用 VSLangProj80.Reference3 类来获取属性,但它不包括“嵌入互操作类型”属性。
我找到了对 Microsoft 内部使用枚举 VsProjReferencePropId100.DISPID_Reference_EmbedInteropTypes 的引用,但不知道如何使用它来查找我正在查找的信息。
I am writing a plugin for Visual Studio, I am able to see all the properties of all the references for a project, except for one property.
How can I access the "Embed Interop Types" property of a reference programmatically?
Right now I am using the VSLangProj80.Reference3 class to get the properties, but it does not include the "Embed Interop Types" property.
I have found a reference to a Microsoft internal use enumeration, VsProjReferencePropId100.DISPID_Reference_EmbedInteropTypes, but don't know how to use it to find the information I am looking for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大量的尝试和错误,我终于成功了。此url 为我指明了正确的方向。
简而言之。 VsLangProj100.dll 不包含 Reference4 接口,新接口应包含 EmbedInteropTypes 属性。解决办法就是自己制作界面。为此,您必须知道接口的 GUID、属性、访问说明符和调度 ID。您可以使用 OLE/COM 对象查看器进行检查。
界面应如下所示,并且一切正常:
Gr
Martijn B
After a lot of trial and error I finally got it working. This url pointed me in the right direction.
In short. VsLangProj100.dll does not include a Reference4 interface, the new interface which should contain the EmbedInteropTypes property. The solution is to make the interface yourself. In order to do this you have to know the GUID of the interface, properties, access specifiers and dispatch id's. You can check this using the OLE/COM Object Viewer.
The interface should look like this and all works fine:
Gr
Martijn B