DLL with same conventions as VC++

torhu fake at address.dude
Wed Jun 20 10:59:45 PDT 2007


Gilles G. wrote:
> Hello,
> I am trying to build a dll using D.
> 
> In my first attempt to write it in C++, I add working calls with the main application by using something like:
>    int __stdcall DLLVersion(){return 1;}
> this also only worked with VC++ using a .def file like (couldn't manage to make it work using borland):
>   EXPORTS
>     DLLVersion
> 
> As I read the documentation, I understand (not sure) that in order to have equivalent calls, I must use:
>   export extern(Windows) int DLLVersion(){return 1;}
> 

That looks correct to me.

> The problem is that the main application doesn't seem torecognize the D DLL.
> Any help would be fantastic!


Did you check out the example in dmd\samples\mydll?

And this page?
http://www.digitalmars.com/d/dll.html



More information about the Digitalmars-d mailing list