![]() |
ErrorCodeToString() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: ErrorHandler.h |
Declaration
static std::string ErrorCodeToString(
DWORD dwErrorCode);
DescriptionConvert an error code to string
Function Body
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";
}
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |