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

MFC - 获取程序当前路径

时间:2016-05-01 21:47:15      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:

 1 //
 2 //    函数        --        GetAppPath()
 3 //
 4 //    功能        --        获取程序的当前路径(路径中带"\\", 不含执行文件名称"\\xx.exe")
 5 //
 6 //    注释        --        
 7 //                         <1>. #include <direct.h>
 8 //                         <2>. _getcwd();                    获取程序当前路径
 9 //
10 CString GetAppPath()
11 {   
14     char szPath[100];
15     ZeroMemory(szPath, 100);
16     _getcwd(szPath, 100);
17     CString strPathName(szPath);
19     return strPathName;
20 }

 

MFC - 获取程序当前路径

标签:

原文地址:http://www.cnblogs.com/DuanLaoYe/p/5451157.html

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