2019-09-15 03:24:12 +08:00
|
|
|
#include "DLL.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
DLL::DLL(std::string fileName) {
|
|
|
|
this->fileName = fileName;
|
|
|
|
this->handle = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
HMODULE DLL::Load() {
|
|
|
|
this->handle = LoadLibraryA(this->fileName.c_str());
|
2019-09-15 07:59:24 +08:00
|
|
|
if (!this->handle) {
|
2019-10-10 18:14:22 +08:00
|
|
|
printf("Could not load %s: %ld\n", this->fileName.c_str(), GetLastError());
|
2019-09-17 09:24:20 +08:00
|
|
|
exit(1);
|
2019-09-15 07:59:24 +08:00
|
|
|
}
|
2019-09-15 03:24:12 +08:00
|
|
|
return this->handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
DLL::~DLL() {
|
|
|
|
//dtor
|
|
|
|
}
|