TCHAR szFilePath[MAX_PATH + 1];GetModuleFileName(NULL, szFilePath, MAX_PATH);(_tcsrchr(szFilePath, _T('\')))[1] = 0; //删除文件名,只获得路径CString str_url = szFilePath;AfxMessageBox(str_url);