jicman Wrote: > Patrick Kristiansen Wrote: > > > Hi > > > > I've been trying out D lately, and I really love it. I use the Tango > > library at the moment, and I wanted to do some simple COM programming, > > which I'm also a newbie at, just to get more acquainted with Windows > > programming in D. > > > > What I want to do is relatively simple I think. I want to use the > > IActiveDesktop COM interface to change the wallpaper of my desktop. So far > > I have ported the definition of the interface to D and the different > > structs used as arguments to the interface's methods. The porting went > > pretty easily, although I haven't been able to test it yet (I'll return to > > that in a moment). The standard Windows types (e.g. LPCTSTR, DWORD, etc.) > > are, as you probably know, defined in tango.sys.win32.Types. > > > > I looked at the samples that is included with the DMD compiler bundle > > (dclient.d, dserver.d and chello.d) to see COM programming in D is done. > > Apparently, one of the first things to do is call CoInitialize(...), and > > this is where my problem arises. > > > > CoInitialize is located in ole32.lib, but in the Tango distribution of DMD, > > there is no ole32.lib included. I thought, since I have the Windows SDK > > (x64) installed, that I could just link directly to the ole32.lib included > > there. > > > > Now, this is probably obvious to some people - but not to me. Why doesn't > > this work? Why does OPTLINK fail and tell me that the format of the .lib > > file is wrong? Is it because Digital Mars compilers produce .lib files in a > > different format? Is it because I have the 64 bit SDK installed, and DMD > > and optlink only produce and consume 32 bit object files and libraries? > > > > Please enlighten me ;-) > > > > Thanks in advance. > > I have been able to use juno (http://www.dsource.org/projects/juno) and use > the windows COM devices to connect to MS Office, Adobe Illustrator, Trados > and a bunch of other windows apps very easily. > > jic
Thanks for all your replies. I'll give it a try. -Patrick
