imradv3 / src /Constant.cpp
fasdfsa's picture
WeChatOcrCpp ok
f0d2225
#include "Constant.h"
#include <filesystem>
#include <Windows.h>
// 当前可执行文件的路径
std::filesystem::path getExecutablePath() {
char path[MAX_PATH];
GetModuleFileNameA(NULL, path, MAX_PATH);
return std::filesystem::path(path).parent_path();
}
const std::filesystem::path Constant::exePath = getExecutablePath(); // std::filesystem::current_path();
const std::filesystem::path Constant::pth_wechatocr_dll = (exePath / std::filesystem::path("WeChatOcrCpp.dll")).lexically_normal(); // .string();
std::filesystem::path curr_pth = std::filesystem::current_path(); // 当前工作目录 (可能是解决方案所在目录)