www.digitalmars.com         C & C++   DMDScript  

D - Using Existing COM/OLE in D

reply J C Calvarese <jcc-47 excite.com> writes:
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I've been trying to use some of Microsoft's COM interfaces in D 
(IPicture and IShellLink).  I've gotten both attempts to compile but 
they don't run correctly (they yield runtime errors before they do 
anything useful).  I've attached the IShellLink attempt in case anyone 
is interested in my approach.  I was trying to use it to create a shortcut.

I was wondering if anyone has successfully used an existing COM 
interface in D.  I know the dmd\samples folder has an example of 
creating a COM client/server in D, but I was wondering if there are any 
examples around with using an interface created in another language. 
I've found examples in C, C++, and Delphi, but I don't I've guessed 
correctly how to do it it D.  I don't know much about COM, but I can be 
pretty stubborn and I've got C code of these programs (using IPicture 
and IShellLink) that I know work.

I'd appreciate any suggestions.  Thanks.

Justin
Mar 29 2003
parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
it works .....

you need extern( Windows ){ ... interfaces .... }

and

in D 'IShellLink obj;'  is the the same as the C 'IShellLink * obj;'
thus
&obj is in C a void** (for the CoCreateInstance last param)

Hope this helps .

"J C Calvarese" <jcc-47 excite.com> wrote in message
news:b65i0q$kb5$1 digitaldaemon.com...
 I've been trying to use some of Microsoft's COM interfaces in D
 (IPicture and IShellLink).  I've gotten both attempts to compile but
 they don't run correctly (they yield runtime errors before they do
 anything useful).  I've attached the IShellLink attempt in case anyone
 is interested in my approach.  I was trying to use it to create a

 I was wondering if anyone has successfully used an existing COM
 interface in D.  I know the dmd\samples folder has an example of
 creating a COM client/server in D, but I was wondering if there are any
 examples around with using an interface created in another language.
 I've found examples in C, C++, and Delphi, but I don't I've guessed
 correctly how to do it it D.  I don't know much about COM, but I can be
 pretty stubborn and I've got C code of these programs (using IPicture
 and IShellLink) that I know work.

 I'd appreciate any suggestions.  Thanks.

 Justin

Mar 29 2003
parent J C Calvarese <jcc-47 excite.com> writes:
Mike Wynn wrote:
 it works .....
 

Thank you very much. Amazing. Yes, it does work. Justin
Mar 29 2003