Thread overview
Using Existing COM/OLE in D
Mar 30, 2003
J C Calvarese
Mar 30, 2003
Mike Wynn
Mar 30, 2003
J C Calvarese
March 30, 2003
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


March 30, 2003
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
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
>



March 30, 2003
Mike Wynn wrote:
> it works .....
> 

Thank you very much.
Amazing.  Yes, it does work.

Justin