Property/Method Descriptions for COM Libraries(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 库的属性/方法描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:COM 库的属性/方法描述


基础教程推荐
- SSE 浮点算术是否可重现? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30