现在的位置: 首页 > 综合 > 正文

如何获取应用程序当前路径

2018年06月06日 ⁄ 综合 ⁄ 共 345字 ⁄ 字号 评论关闭

#include   <windows.h> 
char   fullPath[100]; 
 CString   strPath; 
 memset(fullPath,0,100); 
 GetModuleFileName(AfxGetInstanceHandle(),   fullPath,100);这句也可换成   GetModuleFileName(NULL,   fullPath,100) 
strPath=(CString)fullPath;   
int   position=strPath.ReverseFind('//');   //反向查找"/"所在的位置 
strPath=strPath.Left(position+1);  

 

 

更多技术文章请参看施昌权的个人网站: http://www.joyvc.cn

 

抱歉!评论已关闭.