| // 当前可执行文件的路径 | |
| 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(); // 当前工作目录 (可能是解决方案所在目录) |