VC获取当前程序目录[工作目录 VS 程序启动目录]

01.//帮助文件,返回exe.hlp   
02.CString file = AfxGetApp()->m_pszHelpFilePath;  
03.MessageBox(file);  
04.  
05.//可执行方便全路径   
06.GetModuleFileName(NULL, file.GetBufferSetLength(MAX_PATH + 1), MAX_PATH);  
07.MessageBox(file);  
08.  
09.//运行目录路径   
10.GetCurrentDirectory(MAX_PATH, file.GetBufferSetLength(MAX_PATH + 1));  
11.MessageBox(file);  
原文地址:https://www.cnblogs.com/whisht/p/2221145.html