Property/Method Descriptions for COM Libraries

China☆狼群 提交于 2019-12-01 06:30:40
Hans Passant

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!