**
更新时间:2022-04-08
**
MFC获取当前dll路径(windows版本)
void getCurPath()
{
CString path;
TCHAR curPath[MAX_PATH] = { 0 };
GetModuleFileName(AfxGetInstanceHandle(), curPath, MAX_PATH);
int index = CString(curPath).ReverseFind('\\');
if (index > 0)
{
path = CString(curPath).Left(index + 1);
}
return path;
}
输出:c:xx\xx\