您的位置:首页 > 其它

如何得到当然程序所在的文件夹

2007-08-31 16:51 351 查看
CString strPath;
CString oldpath;
::GetModuleFileName(NULL,strPath.GetBufferSetLength(MAX_PATH+1),
MAX_PATH);
strPath.ReleaseBuffer();
oldpath=strPath;
int nPos=strPath.ReverseFind('//');
strPath=strPath.Left(nPos);
CString strFileName;//.Format("%s",strPath);
strFileName.Format("%s",oldpath);
strFileName = strFileName.Right(strFileName.GetLength() - nPos -1);
AfxGetMainWnd()->SetDlgItemText(IDC_EDIT3,strPath);
AfxGetMainWnd()->SetDlgItemText(IDC_EDIT4,strFileName);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐