【发布时间】:2021-09-03 15:17:34
【问题描述】:
我正在使用 SHELLEXECUTEINFO 对象通过 Visual C++ 执行 C# 控制台应用程序。如何在 Visual C++ 应用程序中读取 C# 控制台应用程序的控制台输出?
到目前为止,这是我的工作代码:
SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "myapp.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess, INFINITE);
【问题讨论】:
标签: c++ winapi visual-c++