ShellExecute
CreateProcess
WinExec

解决方案 »

  1.   

    所谓会者不难,难了不会!楼上不要打击人哦,
    char cCommandLine[MAX_PATH];
    PROCESS_INFORMATION pi;
    STARTUPINFO si = {sizeof(si)}; ::strcpy(cCommandLine, str_path);//str_path   CString类型
    // 启动进程
    BOOL ret = CreateProcess(NULL, cCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
    if (ret){
    // 关闭子进程的主线程句柄
    CloseHandle(pi.hThread);
    // 关闭子进程句柄
    CloseHandle(pi.hProcess);
    }============================================================
    CString ss,sss;
    ss="d:\\aa.exe";
    sss.Format("\"%s\" -L -S", ss);
    WinExec(sss,SW_SHOW);
      

  2.   

    如果要等待mfc程序运行结束的话,再加个
    WaitForSingleObject(pi.hProcess,INFINITE);
    不然就不用了
      

  3.   

    ShellExecute
    WinExec
    这两个最简单
      

  4.   

    如何用mfc文件下打开菜单 启动一个应用程序
      

  5.   

    CFile fs;
    fs.open(
       LPCTSTR lpszFileName,
       UINT nOpenFlags,
       CFileException* pError = NULL 
    );
      

  6.   

    可以使用:
    ShellExecute 
    CreateProcess 
    ShellExecuteEx 
    尽量避免使用:
    WinExec 
      

  7.   

    如下能调用一个计算器:
    UpdateData(TRUE);
    CString STemp(_T("calc.exe ")); USES_CONVERSION;
    char* Str = T2A(STemp.GetBuffer());//系统宏T2A(W2A)
        WinExec(Str,SW_SHOW);