KubuntuLinux上のいくつかのuser32関数のWine実装にアクセスしようとしています。Wine1.1.31パッケージをインストールしています。この簡単なテストプログラムをMonoDevelopで実行しようとすると、が表示され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);
}
}
これは出力です:
未処理の例外:System.EntryPointNotFoundException:GetKeyState at(ラッパー管理からネイティブ)PinvokeTesting.MainClass:GetKeyState(int)at PinvokeTesting.MainClass.Main(System.String [] args)[0x00000] in ... / Main.cs :11
関数はそこにあるはずですが、それが見つかりません。何か案は?私はたくさんの検索をしましたが、役立つものは何も見つかりませんでした。これらの問題に関するドキュメントはかなりまばらなようです(それか、間違ったものを探しています)。
編集: Winformsと組み合わせてP/Invokeを使用しようとはしていません。WineにはP/Invokeする必要のある他の機能がいくつかあります。Mono P / InvoketoWineを機能させようとしています。