| Thread overview | ||||||||
|---|---|---|---|---|---|---|---|---|
|
August 07, 2008 Need help converting basic COM program from C++ to D | ||||
|---|---|---|---|---|
| ||||
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 | ||||
August 07, 2008 Re: Need help converting basic COM program from C++ to D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Chris Burt-Brown | 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.... | |||
August 07, 2008 Re: Need help converting basic COM program from C++ to D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Wyverex | On Fri, 08 Aug 2008 03:03:01 +0400, Wyverex <wyverex.cypher@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@4 just add the following line to the end of .def file: > _Direct3DCreate9@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. | |||
August 08, 2008 Re: Need help converting basic COM program from C++ to D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Chris Burt-Brown | == Quote from Chris Burt-Brown (brokenbeta+newsgroups@gmail.com)'s article > 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 I don't know anything about DirectShow in particular, but there are a couple projects that aim to facilitate using COM with D: * Juno (non-Tango): http://www.dsource.org/projects/juno * DWin (includes port of Juno for Tango): http://www.dsource.org/projects/dwin I don't know that either Juno or DWin has much beginner-level documentation on their websites, but you could probably get some tips via their respective forums (http://www.dsource.org/forums/). | |||
August 18, 2008 Re: Need help converting basic COM program from C++ to D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Chris Burt-Brown Attachments: | 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
>
>
I have tried to get DirectShow to work using D some time ago and created a header file which basically seems to work (offscreen frame grabber tested). Some prototypes are taken from the bindings project. However, if I remember right, all 'LONG' (32-bit) parameters were incorrectly ported as 'long' (64-bit) - so that had to be corrected.
The only problem which remains is a crash with an enabled GC in my test app. I haven't had the time to debug this but it shouldn't be related to the header files.
I'll attach the header files as is and could also post the DShow part of the test application if needed.
| |||
August 19, 2008 Re: Need help converting basic COM program from C++ to D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Sönke Ludwig | Sönke Ludwig 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
> >
> >
>
> I have tried to get DirectShow to work using D some time ago and created a header file which basically seems to work (offscreen frame grabber tested). Some prototypes are taken from the bindings project. However, if I remember right, all 'LONG' (32-bit) parameters were incorrectly ported as 'long' (64-bit) - so that had to be corrected.
>
> The only problem which remains is a crash with an enabled GC in my test app. I haven't had the time to debug this but it shouldn't be related to the header files.
>
> I'll attach the header files as is and could also post the DShow part of the test application if needed.
>
Oh, that's excellent! Thank you!
I knew somebody on this crazy world had to have got there before me :-)
I am now listening to a music file through D and the prospect of making this app has just got a lot more inviting. Thanks!
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply