COM 库的属性/方法描述

Property/Method Descriptions for COM Libraries(COM 库的属性/方法描述)
本文介绍了COM 库的属性/方法描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您创建 COMClass,我注意到当您引用生成的 tlb 文件时,XML 摘要标记中的值不会显示在 VB6/VBA 的对象浏览器中.有没有办法显示这些值?

If you create a COMClass, I've noticed that the values in the XML Summary tag do not show in the object browser of VB6/VBA when you reference the resulting tlb file. Is there a way to have these values show up?

推荐答案

不,12 年的 IntelliSense 发展阻止了它的工作.XML 文档注释会生成一个 IntelliSense 可以提取的 .xml 文件.在 VB6/A 中,文档存在于具有帮助字符串属性的类型库中.例如:

No, 12 years of IntelliSense evolution prevents this from working. The XML documentation comments generates an .xml file that IntelliSense can pick up. In VB6/A, documentation is present in the type library with the helpstring attribute. For example:

[
  odl,
  uuid(2334D2B1-713E-11CF-8AE5-00AA00C00905),
  hidden,
  dual,
  nonextensible,
  oleautomation
]
interface IVBDataObject : IDispatch {
    [id(0x00000001), helpstring("Clears all data and formats in a DataObject object."), helpcontext(0x00033693)]
    HRESULT Clear();
    // etc...
};

从 [ComVisible] 类库中获取相同的内容需要 [Description] 属性.请注意this answer,了解它对属性的工作方式.

Getting the same from your [ComVisible] class library requires the [Description] attribute. Note this answer for a quirk about the way it works for properties.

这篇关于COM 库的属性/方法描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)