I think there is a bigger issue with the mentioned example.
The command cannot work:
dmd test mydll.lib -g

test.d has an import statement to mydll. mydll has to be included in the command. But as mydll not only contains the exported dll functions but also DllMain, it cannot be compiled together with test which contains the main entry point.

Maybe the example can be corrected.

Kind regards
André

On Tuesday, 21 October 2014 at 21:57:06 UTC, Laeeth Isharc wrote:
Funnily enough I was just playing with this last night trying to get Excel to talk to dlang DLL. I borrowed a C example elsewhere on web and used a different .def file. Something like this:

LIBRARY         dprop
DESCRIPTION     'My DLL written in D'

EXETYPE                 NT
CODE            PRELOAD DISCARDABLE
DATA            WRITE

EXPORTS
                useArray = useArray
                usemyTest = usemyTest

Where the two functions exported from D to excel were as above.
Try that and let me know. If that doesn't work I will send you a link to from repository.


Reply via email to