2 #ifndef CYCLUS_SRC_WINDOWS_HELPER_FUNCTIONS_H_ 3 #define CYCLUS_SRC_WINDOWS_HELPER_FUNCTIONS_H_ 13 void DynamicModule::OpenLibrary() {
14 module_library_ = LoadLibrary(path_.c_str());
16 if (!module_library_) {
17 std::string err_msg =
"Unable to load agent shared object file: ";
18 err_msg +=
". Error code is: ";
19 err_msg += GetLastError();
20 throw IOError(err_msg);
25 void DynamicModule::SetConstructor() {
27 GetProcAddress(module_library_, ctor_name_.c_str());
33 ss <<
"Could not find agent " << agent <<
" in module library " 34 << path_.c_str() <<
" (" << GetLastError() <<
").";
35 throw IOError(ss.str());
40 void DynamicModule::CloseLibrary() {
41 if (module_library_) {
42 FreeLibrary(module_library_);
48 #endif // CYCLUS_SRC_WINDOWS_HELPER_FUNCTIONS_H_
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Agent * AgentCtor(Context *)