Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 17, 2006 #import statement in DMC - how to? | ||||
---|---|---|---|---|
| ||||
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! |
January 19, 2006 Re: #import statement in DMC - how to? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy C | 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
|
January 24, 2006 Re: #import, DMC workaround | ||||
---|---|---|---|---|
| ||||
Posted in reply to Scott Michel | 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 |
Copyright © 1999-2021 by the D Language Foundation