//得到当前路径
/*char buf[100];
GetCurrentDirectory(sizeof(buf),buf);
MessageBox(buf);
HINSTANCE hInst=NULL;
hInst=AfxGetApp()->m_hInstance;
char path_buffer[_MAX_PATH];
GetModuleFileName(hInst,path_buffer,sizeof(path_buffer));//得到exe文件的全路径
//分离路径和文件名。
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
_splitpath( path_buffer, drive, dir, fname, ext );
CString Path;
Path.Format("%s%s",drive,dir);
char path[300];
strcpy(path,drive);
strcat(path,dir);
mfc 得到应用程序的文件路径
最新推荐文章于 2024-06-09 12:17:58 发布