imradv3 / src /WeChatOcrCpp /Constant.cpp
fasdfsa's picture
todo: fix link err.
17f5b5c
#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();
}
std::filesystem::path currPath = getExecutablePath(); // std::filesystem::current_path();
const std::string Constant::WeChatOcrData = ( currPath / std::filesystem::path("wco_data") ).lexically_normal().string(); // ".\\wco_data";
#ifdef _WIN64
const std::string Constant::MojoDllName = Constant::WeChatOcrData + "\\mmmojo_64.dll";
#else
const std::string Constant::MojoDllName = Constant::WeChatOcrData + "\\mmmojo.dll";
#endif