Creating A D DLL For Use By VB

starkweatherr at mchsi.com starkweatherr at mchsi.com
Mon Mar 20 03:25:07 PST 2006


Indeed it does work. Thanks.

Now, a post-mortem, if you don't mind.

I assume that, since it worked, the file you called mydll.d is the one with the
DllMain entry point in it and that you didn't make any changes to it?

Nothing new in testdll.d.

The differences in the .def file seem to be significant. I'll need to experiment
to find out why, but, with your .def file I don't get the messages about not
being able to export the function.

The compile part is very different from the sample. I don't work with command
line stuff very often, so please bear with me. The build.bat file I used came
with the demo app. Now it seems clear that the second call to dmd was just to
compile test.dll. The call to implib, though . . . I'm still having trouble
grasping the multiple different ways to create a dll. In this approach you are
using the .def file without implib. As I understand it, if you use implib you
don't need the .def file, or am I lost again?

Anyway, this works, and I will post it with proper credit to you. D looks
interesting. naturally, it has annnoying similarities to C++, but it seems a lot
cleaner. The reason why I got into this in the beginning is that VB, although
great for RAD, lacks both power and sophistication. C++ and D have the power,
but are pretty much useless for RAD. The obvious solution is a combination.
Unfortunately, my programming path went straight from C to VB, with no stop at
C++, so I need the C++/D part to be as easy as possible with eht emphasis on
ease of use of DLLs.

Thanks a lot for your help.

Rory









More information about the Digitalmars-d-learn mailing list