dlxjj/imradv3
0262
1 2#include "Constant.h"3#include <filesystem>4#include <Windows.h>5 6// 当前可执行文件的路径7std::filesystem::path getExecutablePath() {8 char path[MAX_PATH];9 GetModuleFileNameA(NULL, path, MAX_PATH);10 return std::filesystem::path(path).parent_path();11}12 13const std::filesystem::path Constant::exePath = getExecutablePath(); // std::filesystem::current_path();14 15const std::filesystem::path Constant::pth_wechatocr_dll = (exePath / std::filesystem::path("WeChatOcrCpp.dll")).lexically_normal(); // .string();16 17std::filesystem::path curr_pth = std::filesystem::current_path(); // 当前工作目录 (可能是解决方案所在目录)