summaryrefslogtreecommitdiff
path: root/src/cppunit/Win32DynamicLibraryManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cppunit/Win32DynamicLibraryManager.cpp')
-rw-r--r--src/cppunit/Win32DynamicLibraryManager.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cppunit/Win32DynamicLibraryManager.cpp b/src/cppunit/Win32DynamicLibraryManager.cpp
index 2c4ec03..249d692 100644
--- a/src/cppunit/Win32DynamicLibraryManager.cpp
+++ b/src/cppunit/Win32DynamicLibraryManager.cpp
@@ -37,6 +37,34 @@ DynamicLibraryManager::doFindSymbol( const std::string &symbol )
}
+std::string
+DynamicLibraryManager::getLastErrorDetail() const
+{
+ LPVOID lpMsgBuf;
+ ::FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL
+ );
+
+ std::string message = (LPCTSTR)lpMsgBuf;
+
+ // Display the string.
+// ::MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
+
+ // Free the buffer.
+ ::LocalFree( lpMsgBuf );
+
+ return message;
+}
+
+
} // namespace CppUnit