获取当前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

posted @ 2019-06-20 12:04  cicero  阅读(795)  评论(0编辑  收藏  举报