如何得到当然程序所在的文件夹
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);
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);
相关文章推荐
- 如何得到当然程序所在的文件夹
- How To Get Application Path,And How To Get The Path's Directory,File Name,And Type Info(如何得到运行程序的路径,以及如何得到路径的文件夹,文件名,以及类型等等信息)
- C# windows服务:如何获取服务程序所在的文件夹
- JAVA怎样得到当前程序所在文件夹的路径
- 如何得到运行程序的路径,以及如何得到路径的文件夹,文件名,以及类型等等信息
- 打开Word2003时出现“无法访问您试图使用功能所在的网络位置”请按确定重试,或在下面框中输入包含安装程序包genko.msi的文件夹的路径.
- 如何递归得到文件夹里面文件个数以及各个文件地址
- [exit]如何查找事务代码所在程序的用户出口(user-exit)(转)
- 如何得到程序运行时占用的内存?
- [iPhone-cocos2d]如何执行cocos2d官方自带test文件夹下面程序
- 得到程序.exe所在路径
- 如何:click once把程序引用到的文件夹加入到“应用程序文件”列表里
- python程序使用pyinstaller打包成单一.exe文件后,如何的到.exe文件所在目录?
- C# 安装程序制作,如何添加第三方DLL以及自定义的文件夹(如uploadFiles 文件夹)
- 在Blog中插入QQ天气预报如何得到所在城市名称相应的代码?
- 如何查看文件夹被什么程序使用
- 如何在VC6.0中得到一个程序的运行时间,也就是这个程序耗费的时钟周期数// C和C++的时间编程
- 如何用python快速得到文件夹下面的文件名和路径
- 如何用程序得到windows的名称和版本号