15,471
社区成员
发帖
与我相关
我的任务
分享
PROCESS_INFORMATION pi;
STARTUPINFO si;
ZeroMemory(&si, sizeof(STARTUPINFO));
CString strTmp("F:\\Beyond Compare\\BCompare.exe \"C:\\Test\" \"C:\\Test\" ");
CreateProcess(NULL,
strTmp.GetBuffer(strTmp.GetLength()),
NULL,NULL,FALSE,
CREATE_NO_WINDOW,
NULL,NULL,
&si,
&pi);
strTmp.ReleaseBuffer();
WaitForSingleObject(pi.hProcess,INFINITE);
unsigned long result = 0;
GetExitCodeProcess(pi.hProcess, &result );//这里result总是返回错误,返回result为100
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);