Creating A D DLL For Use By VB

strkweatherr at mchsi.com strkweatherr at mchsi.com
Sat Mar 18 16:51:15 PST 2006


I'm having the same problem with DigitalMars D as I had with DigitalMars C/C++,
but nobody over there has answered any of my questions. 

I started with the MyDLL package and modified it so that it accepts two ints and
returns the sum. Test.exe works fine, but VB says the .lib file doesn't exist. I
am assuming that is because it isn't in a recognizable format.

I'm really desperate so I tried:

Public Declare Function addInt _
Lib "E:\DMDWork\MyDll.dll" _
Alias "D5mydll6addIntFiiZi" _
(lngInt1 As Long, _
lngInt2 As Long) _
As Long

As you might expect, I got a Type 49 error.

Another question. When I try to put EXPORTS in the .def file I get error
messages that say there is no entry point for the function. ???

Does anyone have a piece of source code, that works, for a DLL that is
accessible from non-D programs and that is less than 50 lines long?





More information about the Digitalmars-d-learn mailing list