Need help converting basic COM program from C++ to D

Koroskin Denis 2korden at gmail.com
Thu Aug 7 16:45:39 PDT 2008


On Fri, 08 Aug 2008 03:03:01 +0400, Wyverex <wyverex.cypher at gmail.com>  
wrote:

> Chris Burt-Brown wrote:
>> Hi, this my first post and I'm a little lost so please excuse my  
>> missteps.
>>  I am trying to implement this basic little program:
>>  http://msdn.microsoft.com/en-us/library/ms783787(VS.85).aspx
>>  This is a DirectShow "hello world" and I have been looking around for  
>> anyone who has actually connected to DirectShow through D, but it  
>> doesn't appear to have been done. I'm sure that I can cope with a more  
>> complex example if I can get the basics down.
>>  I've searched around and found various other cries for help relating  
>> for COM; they have only served to confuse me further :( and the section  
>> on COM on the Digital Mars website is ... erm, disappointingly brief.
>>  I know that this one's a tricky one. Even the slightest nod in a  
>> direction will be appreciated.
>> Thank you very much.
>>  Chris
>
>
> There is a port for directX in the bindings project on dSource
> http://dsource.org/projects/bindings/browser/trunk/win32/directx
>
> Not complete but a good start..
> Would be nice to get a complete port of DX though...
>
> Also a post about getting it to compile...  
> http://dsource.org/forums/viewtopic.php?t=2217
>
> Other possibility is to write a C dll file in Visual Studio then link to  
> it....

I'm using these binding and have no problems with them.
There are two ways to resolve dll dependencies:
1) easiest one - create a dmd-compatible .lib file to link with your  
application.
    There is a coffimplib utility could be used for that. Grab it here:  
ftp://ftp.digitalmars.com/coffimplib.zip (thanks to Sascha Katzner for the  
hint!)

2) write a .def file that eplicitly enumerates all the dependencies. I.e.  
if you have an error like this:
> Error 42: Symbol Undefined _Direct3DCreate9 at 4
just add the following line to the end of .def file:
> _Direct3DCreate9 at 4=d3d9.Direct3DCreate9

.def file should be linked with an application, too.

I use both and I added my .def files for directx to the SVN in case anyone  
would need them.

Hope this helps.



More information about the Digitalmars-d mailing list