获取当前exe的绝对路径

string GetExePath(void)  
{  
    char szFilePath[MAX_PATH + 1]={0};  
    GetModuleFileNameA(NULL, szFilePath, MAX_PATH);  
    (strrchr(szFilePath, '\\'))[0] = 0; // 删除文件名,只获得路径
    string path = szFilePath;  
  
    return path;  
}  

https://blog.csdn.net/jaken99/article/details/78231872

猜你喜欢

转载自www.cnblogs.com/nanqiang/p/11057944.html