CFileDialog dlg(TRUE);
CString tifPath,savePath,commandStr,exePath;
//dlg.DoModal();
//tifPath = dlg.GetPathName();
tifPath = _T("F:\\tif DEM\\c.tif");//要处理的tif格式DEM,若换成dlg.getPathname()则会出错
savePath = _T("F:\\UAV DEM");//生成的DEM存放路径
exePath = _T("F:\\dstile\\dstile.exe"); //消除路径中的空格
tifPath = _T("\"") + tifPath + _T("\"") ;
savePath = _T("\"") + savePath + _T("\"");
exePath = _T("\"") + exePath + _T("\"") ;
//定义命令commandStr =exePath +  _T(" tile --lztsd 20.0 --wwcache --dem --overviews ")+savePath + _T(" ")+tifPath ;   STARTUPINFO si = {sizeof(si)};
  PROCESS_INFORMATION pi = {0};
  if(!CreateProcess(NULL,commandStr.GetBuffer(),NULL,NULL,false,0,NULL,NULL,&si, &pi))
  {
  MessageBox(L"调用dstile.exe制作高程文件失败!",L"程序出错",MB_OKCANCEL);
  return ;
 
  //CloseHandle(pi.hThread);
  //CloseHandle(pi.hProcess);
  }