views:

592

answers:

2

Given a managed COM object and an associated tlb file, I would like to access it from some unmanaged C++ code WITHOUT using the TLB/import command. But use a header file.

Is there a way to extract a header file from a TLB?

Thanks

+2  A: 

I found it (on a whim). The OLE/COM Viewer allows you to save a TLB file as a header, C, or IDL file! Very cool! Thanks!

A: 

i am unsure why you do not want to use the import command. this will ensure that every time you compile the code you get a header matching the COM library.

otherwise, you risk using an obsolete header in case you forget to manually generate the header.

geva30
Well, I personally found this question (and accepted answer) because I was looking for the same thing because I cross-compile a Windows DLL on Linux using MinGW compiler which doesn't support #import directive
martinsb