www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - #import statement in DMC - how to?

reply Andy C <Andy_member pathlink.com> writes:
I am working on the great DMC plugin for Eclipse that scooter developed (slowly
trying to update it to ver 3, but I am way down on the Eclipse/Java learning
curve) and I have run into a DMC vs MSVC issue.  
I have a chunk of code that used the directive: #import "thing.tlb"  , and I
have two files that were provided to me, thing.tlb and thing.dll (no .h file).
What is the proper method of replacing the #import statement in MSVC.

Thanks,
Andy C


Greetings from Pittsburgh PA, home of the tax-subsidized Stealers!
Jan 17 2006
parent reply Scott Michel <scottm aero.org> writes:
Andy C wrote:
 I am working on the great DMC plugin for Eclipse that scooter developed (slowly
 trying to update it to ver 3, but I am way down on the Eclipse/Java learning
 curve) and I have run into a DMC vs MSVC issue.  
 I have a chunk of code that used the directive: #import "thing.tlb"  , and I
 have two files that were provided to me, thing.tlb and thing.dll (no .h file).
 What is the proper method of replacing the #import statement in MSVC.
Doing a quick-and-dirty search on what '#import' is supposed to do, it turns out that the MSVC compiler does some interesting transformation to the contents of the 'tlb' file to generate usable C++ classes. So I rather doubt that there is an equivalent in DMC. That said, it would almost appear as if the contents of the tlb file are C code -- importing it just rewraps the contents as C++. -scooter
Jan 18 2006
parent Andy C <Andy_member pathlink.com> writes:
Yes.  #import takes the objects in a .tlb or .odl file and wraps the type
library contents in C++ classes to simplify calling them.  The output is a .thl
and .thi that contains forward references and typedefs, as well as smart ptr
declarations using _com_ptr_t.  It would require installing some ATL features
from the Platform SDK.
I will implement a workaround just to get the Eclipse plugin back on track, but
this is a good candidate for a future Eclipse tool.

Andy C


Doing a quick-and-dirty search on what '#import' is supposed to do, it
turns out that the MSVC compiler does some interesting transformation to
the contents of the 'tlb' file to generate usable C++ classes. So I
rather doubt that there is an equivalent in DMC.

That said, it would almost appear as if the contents of the tlb file are
C code -- importing it just rewraps the contents as C++.


-scooter
Jan 24 2006