GetArxPath

extern HINSTANCE _hdllInstance;
CString GetArxPath()
{
CString strArxPath;
GetModuleFileName(_hdllInstance, strArxPath.GetBuffer(255), 255);
strArxPath.ReleaseBuffer();
// char *ch = strArxPath.GetBuffer(sizeof(strArxPath));
TCHAR dir[_MAX_DIR], drive[_MAX_DRIVE], path[_MAX_PATH], fileName[_MAX_FNAME];
_wsplitpath(strArxPath, drive, dir, fileName, NULL);
// _splitpath(strArxPath, drive, dir, fileName, NULL);

CString strPath; //获取路径名
strPath.Format(_T("%s%s"), drive, dir);

return strPath;
}

原文地址:https://www.cnblogs.com/xzh1993/p/5405171.html