Take the 2-minute tour ×

I'm trying to create an D application which uses a (third party) COM .dll so I can scrape a text box of another application so I can sound an error when a certain string shows up.

However the third party doesn't provide .lib, .def or .h files that go with the dll (atleast with the free trial version). I can create the .lib file with the implib tool but I don't see any of the library's functions in the created .lib.

Their (visual c++) samples use the #import directive to link it in however that is of no use for me ...

On a side note how can I get the proper interfaces (in a .di with boilerplate that does the linking) of the dll automatically? I ask so the correctness of the linkage doesn't depend on my (likely to be incorrect) translation of the functions. They do have a webpage which gives all functions but the object model is a bit chaotic to say the least.

share|improve this question
add comment

2 Answers

From what I know, COM libraries only expose a few functions, required to (un)register the library and to create objects. You can however view the interfaces and functions in a COM .dll using the OLE/COM Object Viewer. It seems it might be able to output header files (.h). Afterwards, maybe you could use htod as a starting point to converting everything to D interfaces.

The DMD distribution seems to include a .COM sample (chello.d, dclient.d, dserver.d), and at first glance it doesn't look like it would require any LIBs explicitly.

Unfortunately, I've never actually used COM in D, so I can't advise any further. I hope this helps in some way.

share|improve this answer
add comment

While I have yet to actually do COM work myself, I am trying to revive Juno over on Github/he-the-great. Part of the project is tlbimpd which is what will output a D file from a DLL.

I've tested the examples and successfully run tlbimpd. Please do try things out for your use and submit any issues.

share|improve this answer
add comment

Your Answer


