+ #ifdef WIN32
+ DWORD dwLastError = ::GetLastError();
+ LPSTR messageBuffer = NULL;
+ size_t size = ::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ dwLastError,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPSTR)&messageBuffer, 0, NULL);
+ anErrorMsg += ": " + std::string(messageBuffer, size);
+ #else