下面语句是MFC中代码,我调用外部exe文件并把结果写到outfile.dat中,但结果只能在控制台输出。求救
SHELLEXECUTEINFOShExecInfo={0};ShExecInfo.cbSize=sizeof(SHELLEXECUTEINFO);ShExecInfo....
SHELLEXECUTEINFO ShExecInfo={0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = _T("open");
ShExecInfo.lpFile = _T("crf_test.exe");
ShExecInfo.lpParameters=_T(" -m model test.dat > outfile.dat");
ShExecInfo.lpDirectory =NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
这是调用
ShellExecuteEx()
函数 展开
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = _T("open");
ShExecInfo.lpFile = _T("crf_test.exe");
ShExecInfo.lpParameters=_T(" -m model test.dat > outfile.dat");
ShExecInfo.lpDirectory =NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
这是调用
ShellExecuteEx()
函数 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询