2 #include "module_private.h"
3 #include "systemerror.h"
9 Module::Module(const string &name)
11 ModuleHandle handle = LoadLibrary(name.c_str());
13 throw system_error("LoadLibrary");
16 priv->handle = handle;
21 FreeLibrary(priv->handle);
25 void *Module::get_symbol(const string &name) const
27 FARPROC result = GetProcAddress(priv->handle, name.c_str());
29 throw system_error("GetProcAddress");
31 return reinterpret_cast<void *>(result);