mfc 启动exe方式

ShellExecute

CreateProcess


PROCESS_INFORMATION pi;
    STARTUPINFO si = {sizeof(si)};
DWORD dwExitCode;
    BOOL ret = CreateProcess(NULL, "C:\\jcb_hlzq\\TdxW.exe", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
    if(ret){
CloseHandle(pi.hThread);
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &dwExitCode);
CloseHandle(pi.hProcess);
    }
要if就等待exe进程处理完,不要if就是个执行个的不管。
BOOL ret = CreateProcess(NULL, "C:\\jcb_hlzq\\TdxW.exe    /aa   /sss   /ddddd", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
可以试一试后面的参数

你可能感兴趣的:(mfc)