Linuxで実行するためにWindowsC#アプリケーションを移植しています。このアプリケーションは、WindowsシステムライブラリへのPInvoke呼び出しを利用します。これはLinuxでは使用できません。
これが私が移植に問題を抱えているコードセクションの抜粋です:
namespace MyApp
{
static class Program
{
[DllImport("kernel32.dll")]
static extern bool AttachConsole(int dwProcessId);
private const int ATTACH_PARENT_PROCESS = -1;
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr HWND, int CMDSHOW);
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
AttachConsole(ATTACH_PARENT_PROCESS);
// ...
}
}
}
モノフレームワークに同様の機能はありますか?いいえの場合、Monoで同様の動作を実装するにはどうすればよいですか?Ubuntu10.0.4LTSで実行しています