1 #include <cppunit/Portability.h>
3 #if defined(CPPUNIT_HAVE_WIN32_DLL_LOADER)
4 #include <cppunit/plugin/DynamicLibraryManager.h>
6 #define WIN32_LEAN_AND_MEAN
12 #define BLENDFUNCTION void // for mingw & gcc
19 DynamicLibraryManager::LibraryHandle
20 DynamicLibraryManager::doLoadLibrary( const std::string &libraryName )
22 return ::LoadLibraryA( libraryName.c_str() );
27 DynamicLibraryManager::doReleaseLibrary()
29 ::FreeLibrary( (HINSTANCE)m_libraryHandle );
33 DynamicLibraryManager::Symbol
34 DynamicLibraryManager::doFindSymbol( const std::string &symbol )
36 return (DynamicLibraryManager::Symbol)::GetProcAddress(
37 (HINSTANCE)m_libraryHandle,
43 DynamicLibraryManager::getLastErrorDetail() const
47 FORMAT_MESSAGE_ALLOCATE_BUFFER |
48 FORMAT_MESSAGE_FROM_SYSTEM |
49 FORMAT_MESSAGE_IGNORE_INSERTS,
52 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
58 std::string message = (LPCSTR)lpMsgBuf;
60 // Display the string.
61 // ::MessageBoxA( NULL, (LPCSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
64 ::LocalFree( lpMsgBuf );
73 #endif // defined(CPPUNIT_HAVE_WIN32_DLL_LOADER)