COM 库的属性/方法描述

发布于 2024-09-12 13:18:07 字数 89 浏览 1 评论 0原文

如果您创建 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

今天小雨转甜 2024-09-19 13:18:07

不,12 年的 IntelliSense 发展阻止了这一点。 XML 文档注释生成一个 IntelliSense 可以拾取的 .xml 文件。

在 VB6/A 中,文档存在于带有 helpstring 属性的类型库中。例如:

[
  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] 属性。请注意此答案,了解它对属性的工作方式的怪癖。

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文