www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - COM Example work for anyone?

reply "Jesse Phillips" <jessekphillips+D gmail.com> writes:
The dmd compiler comes with some example code. One of the 
examples is for COM.

Does this work for anyone else? The dll registration code is 
failing: SetKeyAndValue() failed.

Other output looks good:

OLE 2 initialized
hMod = 268435456
LoadLibraryA() succeeded
pfn = 100033E0, fn = 'DllRegisterServer'

dmd -ofdserver .\dserver.d .\chello.d .\dserver.def
dmd .\dclient.d .\chello.d

I also added a couple pragma's to the files to help with linking

pragma(lib, "advapi32.lib");
pragma(lib, "ole32.lib");

pragma(lib, "oleaut32.lib");
pragma(lib, "ole32.lib");
Oct 13 2012
parent reply "Richard Webb" <webby beardmouse.org.uk> writes:
I haven't tried to run it, but as a random guess, does the user 
your running it as have permissions to write to HKEY_CLASSES_ROOT 
?
Oct 14 2012
parent "Jesse Phillips" <jessekphillips+D gmail.com> writes:
On Sunday, 14 October 2012 at 19:04:22 UTC, Richard Webb wrote:
 I haven't tried to run it, but as a random guess, does the user 
 your running it as have permissions to write to 
 HKEY_CLASSES_ROOT ?
Guess that would be it. Specifically told the program to run as admin and it works. Should have checked if you left a message here first, but GitHub is better about telling me new messages. My comserver branch's example also has the registration through manifest which I'm not getting to work. Wonder if it is the same issue... This should at least get me started building customer servers such that I can build a much better understanding of how these all fit together and test what works vs what is an environment issue. But I'm getting a little tired for now so I'll probably look at some other aspects for a bit. Thanks for watching my work and helping.
Oct 14 2012