D2 Win API Problem

torhu no at spam.invalid
Sun Sep 20 12:18:04 PDT 2009


On 20.09.2009 20:11, A Bothe wrote:
> Hello guys,
> I got a problem with the following code. I can compile it successfully but when I want to start it, there is just this "object.AccessVialotion"!
> Even GetLastError() returns 0.... so the problem cannot be found in  wrong-written names...
>
> Thanks in advance!
>
> import std.loader, std.c.windows.windows;
>
> int function(HWND hwnd,char* text,char* title, uint style) tfunc=null;
>

Try adding "extern (Windows)" before the function pointer declaration. 
That'll select the stdcall calling convention, which most of the Windows 
API uses.


More information about the Digitalmars-d-learn mailing list