[Mono-list] Win32 API problems

Paolo Molaro lupus@ximian.com
Fri, 14 Jun 2002 12:26:31 +0200


On 06/13/02 Adiraj, Sarat wrote:
> [DllImport("user32")]
> public static extern int MessageBoxA(int hWnd, 
> String pText ,
> String pCaption ,
> int uType);

What is the signature of the MessageBoxA() function in C code?
There may be two issues:
1) we currently marshal strings as utf8 char*. MessageBoxA() for all I
know may want UTF-16 (though I guess the 'A' is for ASCII?).
2) The call convention: we call the P/Invoke function with th cdecl call
convention by default. It may be that MessageBoxA() uses another
convention.

You could try to run the code with the ms runtime and check if it works
there.

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better