Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Windows8 でコンソール (親プロセスが cmd.exe) アプリケーションを実行すると、AttachConsole(ATTACH_PARENT_PROCESS) は TRUE を返し、GetLastError() は ERROR_NOT_SUPPORTED を返します。このOSで使用できる代替手段はありますか?
AttachConsole が true を返す場合、GetLastError の値はランダムです (つまり、AttachConsole または実際に Win32 API 関数の呼び出しが成功しても、最後のエラー コードはリセットされません)。エラーコードが設定されている場合のみ、エラーコードを確認してください。