如何检查TLB文件中的原始COM定义

How to inspect raw COM definitions in a TLB file?

本文关键字:原始 COM 定义 文件 TLB 何检查 检查      更新时间:2023-10-16

一个现有的非托管c++项目使用一个在c#中声明和实现的COM组件,我的头看起来有点像这样:

#import "MyComponents.tlb" no_namespace named_guids
IComponentXYZ *pComponent;

有时当我右键单击。h文件中的IComponentXYZ并"Go to declaration"时,会显示一个MyComponent.tlh文件,其中显示了COM包装器定义。但其他时候,它说没有定义存在。

我可以在Visual Studio中手动打开此文件吗?我认为它是自动生成的。虽然Object Browser窗口允许我检查TLB内容,但它不显示原始的COM方法声明。

二十年前我也使用过OLEView。查看TLB内部的其他一些好工具是:

COMView

  • http://comview.allapp.biz/
  • https://www.softpedia.com/get/System/System-Info/COMView.shtml

非常有用…