// 获取当前exe位置
std::string GetExePath()
{
char szPath[MAX_PATH]={0};
GetModuleFileNameA(NULL, szPath, MAX_PATH);
std::string path = std::string(szPath);
size_t pos = path.find_last_of("\\");
path = path.substr(0, pos);
return path;
}
// 获取dll位置
std::string GetDllPath(const char* dllName)
{
char szPath[MAX_PATH]={0};
GetModuleFileNameA(::GetModuleHandleA(dllName), szPath, MAX_PATH);
std::string path = std::string(szPath);
size_t pos = path.find_last_of("\\");
path = path.substr(0, pos);
return path;
}