Adam Ryczkowski
Adam Ryczkowski

Reputation: 8064

How to write the sample COM Server in Visual D

I'm struggling to get a simple COM Server running in Visual D 2010. These are the steps I did so far:

  1. Clean Visual D 2010 solution of type Dynamic Library (DLL)
  2. I've copied contents of dserver.d into dllmain.d
  3. I've copied file chello.d and dserver.def into the solution's source folder, as well as advapi32.lib and ole32.lib from the <D install dir>\dmd2\windows\lib.
  4. I've added the copied file into the solution by right-clicking the project in the solution explorer and Add->Existing item...
  5. Renamed file dserver.def into dll.def, overwriting existing project's file.
  6. Applied a patch to the chello.d and dllmain.d (originally dserver.d) as written on this forum thread
  7. Build Debug. No errors.
  8. Calling regsvr32 COMServer.dll returns these four message boxes:

enter image description here

then

enter image description here

then

enter image description here

and finally

enter image description here

I am still unable to access the COM object from VBA. And referencing the DLL directly (by Browse... button and pointing to the COMServer.dll) fails with "Can't add a reference to the specified file."

Upvotes: 1

Views: 200

Answers (2)

Adam D. Ruppe
Adam D. Ruppe

Reputation: 25595

I took another look at the forums and the problem with the samples seems related to TLS on Windows XP. I posted a (somewhat hacky) solution to it here:

http://forum.dlang.org/thread/[email protected]?page=2

Upvotes: 1

he_the_great
he_the_great

Reputation: 6774

I can't provide you with a working answer. It looks like this was a year ago, I was trying to get an example of using a COM server working. This uses Juno (not 64bit ready), has nothing to do with Visual D, and most importantly I couldn't get to work. The issue I hit was related to registering the server ("side-by-side configuration is incorrect").

My qualifications for COM are all there in the history of Juno (so not much of any). If you're more familiar with COM you may get further, if it doesn't compile for the latest DMD let me know (2.064 isn't out yet anyway).

Upvotes: 0

Related Questions