Helper method to retrieve the error when DLL load failed.
| 15 | |
| 16 | // Helper method to retrieve the error when DLL load failed. |
| 17 | std::string FormatGetLastError() |
| 18 | { |
| 19 | static wchar_t buf[FORMAT_BUFSIZE]; |
| 20 | FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_IGNORE_INSERTS, |
| 21 | NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language |
| 22 | buf, |
| 23 | FORMAT_BUFSIZE, NULL); |
| 24 | return string::unicode_to_utf8(buf); |
| 25 | } |
| 26 | |
| 27 | DynamicLibrary::DynamicLibrary(const std::string& filename) : |
| 28 | _name(filename.begin(), filename.end()), |
no test coverage detected