龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

使用VC++开发考场随机排座系统[组图](2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
startInfo.lpTitle = buf; startInfo.lpDesktop = NULL; startInfo.dwX = 0; startInfo.dwY = 0; startInfo.dwXSize = 0; startInfo.dwYSize = 0; startInfo.dwXCountChars = 0; startInfo.dwYCountChars = 0; start

startInfo.lpTitle           =   buf;

startInfo.lpDesktop        =   NULL;

startInfo.dwX            =   0;

startInfo.dwY            =   0;

startInfo.dwXSize         =   0;

startInfo.dwYSize         =   0;

startInfo.dwXCountChars   =   0;

startInfo.dwYCountChars  =   0;

startInfo.dwFlags        =   STARTF_USESTDHANDLES;

startInfo.wShowWindow    =   0;   //SW_SHOWDEFAULT;

startInfo.lpReserved2    =   NULL;

startInfo.cbReserved2    =   0;

startInfo.hStdInput      =   0;

startInfo.hStdOutput     =   0;

startInfo.hStdError      =   0;

//产生新的进程,运行命令行,调用转换引擎进行转换

int nRet=CreateProcess(

                     NULL,

                     cmdll,

                     NULL,

                     NULL,

                     TRUE,

                     0, //CREATE_NEW_CONSOLE

                     NULL,

                     NULL,

                     &startInfo,

                     &pidInfo);

       if(!nRet)

       {

              AfxMessageBox("调用引擎失败,程序将退出!",MB_OK|MB_ICONSTOP);

              return -1;

       }

       DWORD dwWait=WaitForSingleObject(pidInfo.hProcess, INFINITE); //等待进程结束

       return;

精彩图集

赞助商链接