|
|
|
@ -53,8 +53,9 @@ public:
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
#else
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <exception>
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
#ifndef NOMINMAX
|
|
|
|
@ -76,9 +77,9 @@ public:
|
|
|
|
|
|
|
|
|
|
Dlhandle() : chandle(nullptr) {}
|
|
|
|
|
Dlhandle(const std::string& fpath) {
|
|
|
|
|
std::string path = fpath;
|
|
|
|
|
std::replace(path.begin(), path.end(), '/', '\\');
|
|
|
|
|
chandle = LoadLibraryExA(path.c_str(), NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
|
|
|
|
|
std::string afpath = std::filesystem::absolute(fpath).string();
|
|
|
|
|
std::replace(afpath.begin(), afpath.end(), '/', '\\');
|
|
|
|
|
chandle = LoadLibraryExA(afpath.c_str(), NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
|
|
|
|
|
if (!chandle) {
|
|
|
|
|
throw Exception("dlopen(\""+fpath+"\"): Error");
|
|
|
|
|
}
|
|
|
|
|