Go to the documentation of this file.00001
00002 #include "../pch.h"
00003
00004
00005 #define LOADDLL(file) (HMODULE)LoadLibrary(file)
00006 #define LOADFUNC(dll, name) GetProcAddress((HMODULE)dll, name)
00007 #define FREEDLL(dll) FreeLibrary((HMODULE)dll)
00008
00009
00010 Module::Module(const wchar* c){
00011 this->fpCreate = 0;
00012 this->fpFree = 0;
00013 this->module = LOADDLL((const wchar*)c);
00014 if(this->module == 0)
00015 return;
00016
00017 this->fpCreate = (FPCREATE)LOADFUNC(this->module, "Create");
00018 if(this->fpCreate == 0){
00019 printf("%s\n", "No Create Function found");
00020 return;
00021 }
00022
00023 this->fpFree = (FPFREE)LOADFUNC(this->module, "Free");
00024 if(this->fpFree == 0){
00025 printf("%s\n", "No Create Function found");
00026 return;
00027 }
00028 }
00029
00030 Module::~Module(void){
00031 this->module = 0;
00032 this->fpCreate = 0;
00033 this->fpFree = 0;
00034 }