Here is how we do windows dll calls in SWF.

                [DllImport ("user32.dll", 
                         CallingConvention = CallingConvention.StdCall, 
                         CharSet = CharSet.Auto)]
                internal static extern int MessageBoxA (
                        IntPtr hWnd, string pText, string pCaption, uint
uType);

Dennis

Message: 9
Subject: Re: [Mono-list] Mono/.NET delegate incompatibility
From: Miguel de Icaza <[EMAIL PROTECTED]>
To: "J. Perkins" <[EMAIL PROTECTED]>
Cc: Mono-L <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Organization:
Date: 18 Dec 2002 19:41:30 -0500

Hello,

> I am using a delegate to pass a function pointer into a unmanaged DLL.
> Under Linux/Mono everything works fine. Under Windows/.NET, my callback
> function signature must look like this:
> 
>   void (__stdcall *func)(int);
> 
> But Windows/Mono seems to want:
> 
>   void (*func)(int);

__stdcall is a Microsoft-C feature, so it is really a feature of your
compiler.  There are some macros around that you can use to make your C
code portable (not really Mono's domain), like STDCALL that get defined
to nothing on Unix.

Miguel

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to