ShellExecute()函数打开一个文档,文档路径中存在空格该如何处理?
TCHAR exeFullPath[_MAX_PATH];
CString stmp;
GetModuleFileName(NULL,exeFullPath,_MAX_PATH);
stmp = exeFullPath;
int n = stmp.ReverseFind('\\');
stmp = stmp.Mid(0,n+1);
stmp += "material code for vivo.xls";//出现空格
stmp.Replace(" ","%20");
HINSTANCE hs = ShellExecute(this->m_hWnd,"open","excel.exe",stmp,"",SW_SHOW);//执行时excel.exe去打开material.xls 而不是打开material code for vivo.xls
请问该如何处理才能打开路径中带有空格的文档?多谢!