9 #include "fwRuntime/dl/Win32.hpp" 11 #include <fwCore/base.hpp> 21 Win32::Win32(
const boost::filesystem::path & modulePath ) noexcept :
29 bool Win32::isLoaded() const noexcept
36 void * Win32::getSymbol(
const std::string& name )
const 40 symbol = GetProcAddress( m_handle, name.c_str() );
43 throw RuntimeException(
"'" + name +
"': symbol retrieval failed.");
55 std::string lib(getFullPath(
true).
string());
56 OSLM_TRACE(
"Opens the dynamic library " << lib);
57 m_handle = LoadLibrary( lib.c_str() );
61 DWORD lastError = GetLastError();
63 FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, 0, lastError, 0, buffer, 1024, 0 );
66 std::string message( buffer );
67 throw RuntimeException( message );
79 result = FreeLibrary(m_handle);
82 throw RuntimeException(
"Module unload failed.");
95 #endif // #ifdef _WIN32 #define OSLM_TRACE(message)
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...