File size: 655 Bytes
17f5b5c f0d2225 17f5b5c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#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(); // 当前工作目录 (可能是解决方案所在目录) |