![]() |
ErrorCodeToString() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: ErrorHandler.h |
static std::string ErrorCodeToString( DWORD dwErrorCode);
Convert an error code to string
try { //Get the error string LPVOID lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL); //Save it std::string sMessage; sMessage+=(char*)lpMsgBuf; //Release the buffer LocalFree(lpMsgBuf); //Done return sMessage; } catch (...) { return "Unknown"; }
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |