Linking against a Win32-DLL

Jascha Wetzel firstname at mainia.de
Tue Jul 10 11:29:33 PDT 2007


yep, sounds like __stdcall without decoration.

alternatively, you can write a .def file (if you don't have it already), 
use aliases with decorated names and create the .lib file from that.
there should be plenty of resources on the net on how to do this.

torhu wrote:
> Sounds like you're describing stdcall.
> 
> You could use extern (Pascal) only to be able to link with the symbol,
> then assign the address of the function to an extern (Windows) pointer,
> and call it through that.  This is all in theory, of course.
> 
> ---
> typedef extern (Windows) UINT function(UINT , UINT , LPVOID) WTInfoA_type;
> 
> extern (Pascal) UINT WTInfoA(UINT , UINT , LPVOID);
> 
> WTInfoA_type WTInfoA_ptr;
> 
> void main()
> {
>    WTInfoA_ptr = cast(WTInfoA_type)&WTInfoA;
>    WTInfoA_ptr(/* args here*/);
> }
> ---
> 
> Untested code, but it looks plausible.



More information about the Digitalmars-d mailing list