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 库的属性/方法描述


基础教程推荐
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01