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

 
	//帮助文件,返回exe.hlp
	CString file = AfxGetApp()->m_pszHelpFilePath;
	MessageBox(file);

	//可执行方便全路径
	GetModuleFileName(NULL, file.GetBufferSetLength(MAX_PATH + 1), MAX_PATH);
	MessageBox(file);

	//运行目录路径
	GetCurrentDirectory(MAX_PATH, file.GetBufferSetLength(MAX_PATH + 1));
	MessageBox(file);

原文地址:https://www.cnblogs.com/whisht/p/4098863.html