Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to inspect raw COM definitions in a TLB file?

An existing unmanaged C++ project uses a COM component declared and implemented in C#, and my header looks a bit like this:

#import "MyComponents.tlb" no_namespace named_guids

IComponentXYZ *pComponent;

Sometimes when I right-click on IComponentXYZ in the .h file and "Go to declaration", a MyComponent.tlh file is displayed which shows me the COM wrapper definitions. But other times, it says no definition exists.

Can I manually open this file in Visual Studio? I think it's being auto-generated. And while the Object Browser window lets me inspect TLB contents, it doesn't display the raw COM method declarations.

like image 601
Mr. Boy Avatar asked Oct 07 '15 15:10

Mr. Boy


People also ask

How do I view the contents of a TLB file?

Do File > View TypeLib , open your . tlb file. The tool decompiles back to IDL, essentially. Worked for me.

How do I view TypeLib?

On the object viewer File menu, click View TypeLib. An Open dialog box appears. Specify the type library file you want to open, and click OK.

What is a TLB file?

A type library (. tlb) is a binary file that stores information about a COM or DCOM object's properties and methods in a form that is accessible to other applications at runtime. Using a type library, an application or browser can determine which interfaces an object supports, and invoke an object's interface methods.

How do I import a TLB file into VC ++?

Type library file(. tlb) is not considered as typical library file, the compiler won't try to find it from "Tool -> Options -> VC++ Directories -> Library Files". You can add it as reference or import it with full path.


1 Answers

I also used OLEView twenty years ago. Some other good tool for looking inside a TLB and much more is:

COMView

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

Very helpful...

like image 92
jreichert Avatar answered Sep 28 '22 08:09

jreichert