MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / GetErrorDescription

Method GetErrorDescription

deps/FtpClient/Definements.h:127–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 static DWORD GetLastError() { return ::GetLastError(); }
126
127 static tstring GetErrorDescription(int iErrorCode = GetLastError())
128 {
129 LPVOID lpMsgBuf=NULL;
130 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
131 NULL, iErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
132 reinterpret_cast<LPTSTR>(&lpMsgBuf), 0, NULL);
133 tstring strErrorDescription;
134 if( lpMsgBuf )
135 {
136 strErrorDescription = reinterpret_cast<LPTSTR>(lpMsgBuf);
137 LocalFree(lpMsgBuf);
138 }
139 return strErrorDescription;
140 }
141 };
142#else
143 /// Class with static functions to get information about an error.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected