我使用ShellExecuteEx函数调用exe执行文件时总是弹出:“Windows找不懂*.exe,请确定文件名是否正确之后,再次尝试。”请问哪位高手可以给我指导指导。谢谢。

解决方案 »

  1.   

    这是我的源代码:
    SHELLEXECUTEINFO  ShExecInfo  =  {0};  
     ShExecInfo.cbSize  =  sizeof(SHELLEXECUTEINFO);  
     ShExecInfo.fMask  =  SEE_MASK_NOCLOSEPROCESS;  
     ShExecInfo.hwnd  =  NULL;  
     ShExecInfo.lpVerb  =  _T("open");  
     ShExecInfo.lpFile  =  _T("D2.exe");                          
     ShExecInfo.lpParameters  =  _T("-f train");              
     ShExecInfo.lpDirectory  =  NULL;  
     ShExecInfo.nShow  =  SW_HIDE;  
     ShExecInfo.hInstApp  =  NULL;              
     ShellExecuteEx(&ShExecInfo); 
     BeginWaitCursor();
     WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
     EndWaitCursor();
      

  2.   

    没找到D2.exe文件,把这个文件放在应用程序同级目录下·
      

  3.   

    SHELLEXECUTEINFO ShExecInfo = {0};   
    ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);   
    ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;   
    ShExecInfo.hwnd = NULL;   
    ShExecInfo.lpVerb = _T("open");   
    ShExecInfo.lpFile = _T("C:\\Windows\\notepad.exe");   
    ShExecInfo.lpParameters = NULL;   
    ShExecInfo.lpDirectory = NULL;   
    ShExecInfo.nShow = SW_SHOW;   
    ShExecInfo.hInstApp = NULL;   
    ShellExecuteEx(&ShExecInfo);  
    BeginWaitCursor();
    WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
    EndWaitCursor();这个我试了一下 没问题