Title: Win32 API problems

mono causes a stack overflow when i try to use pinvoke for calling a win32 function.The code i used is as follows:

namespace APIExample
{
using System;
// Must refernce this library to use PI nvoke types
using System.Runtime.InteropServices;
public class PinvokeClient
{
       
[DllImport("user32")]
public static extern int MessageBoxA(int hWnd,
String pText ,
String pCaption ,
int uType);
public static int Main(string[] args)
{
int res;
String pText = "HELLO World!!";
String pCaption = "Example by Sarat";
res = MessageBoxA(0,pText,pCaption,0);
Console.WriteLine(res);
return 0;
}
}
}

please advice if this is a bug with mono or if it is something wrong with my code.

-- Sarat


Reply via email to