I'm trying to access the Wine implementation of some user32 functions on Kubuntu Linux. I have the Wine 1.1.31 package installed. When try running this simple test program in MonoDevelop, I get a System.EntryPointNotFoundException
.
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace PinvokeTesting
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine(GetKeyState((int)Keys.A));
}
[DllImport("user32")]
private static extern short GetKeyState(int vKey);
}
}
This is the output:
Unhandled Exception: System.EntryPointNotFoundException: GetKeyState at (wrapper managed-to-native) PinvokeTesting.MainClass:GetKeyState (int) at PinvokeTesting.MainClass.Main (System.String[] args) [0x00000] in .../Main.cs:11
The function should be there, but it's not finding it. Any ideas? I've done a lot of searching, haven't found anything helpful. The documentation seems to be rather sparse on these issues (either that or I'm searching for the wrong things).
Edit: I'm not trying to use P/Invoke in combination with Winforms, there are some other functions in Wine I need to P/Invoke to. I'm just trying to get Mono P/Invoke to Wine working.