DLL with same conventions as VC++

torhu fake at address.dude
Wed Jun 20 15:28:35 PDT 2007


Gilles G. wrote:
> torhu Wrote:
> 
>> 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
> Yes, of course!
> I use the same method: export and .def file.
> I understood the following:
> export extern(Windows) <=> __stdcall
> export extern(C) <=> __cdecl
> 
> Does anybody have any idea what could be the (subtle) difference?

Do you still have problems?  Please post the exact error messages you 
get, in English.  And maybe your source code and command lines too.



More information about the Digitalmars-d mailing list