码迷,mamicode.com
首页 > 编程语言 > 详细

MFC 获得当前项目的.exe文件路径

时间:2014-11-06 17:45:26      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:os   sp   文件   ef   as   程序   file   c   class   

//得到程序的路径(strTemp就是当前项目中.exe的所在目录)
	CString  sPath, strTemp;
	GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
	sPath.ReleaseBuffer();
	int nPos = sPath.ReverseFind('\\');
	strTemp  = sPath.Left(nPos);

MFC 获得当前项目的.exe文件路径

标签:os   sp   文件   ef   as   程序   file   c   class   

原文地址:http://blog.csdn.net/qq_17242957/article/details/40861461

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!