MCPcopy Create free account
hub / github.com/MITK/MITK / GetLastErrorStr

Function GetLastErrorStr

Modules/CppMicroServices/src/usUtils.cpp:206–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204namespace us {
205
206std::string GetLastErrorStr()
207{
208#ifdef US_PLATFORM_POSIX
209 return std::string(strerror(errno));
210#else
211 // Retrieve the system error message for the last-error code
212 LPVOID lpMsgBuf;
213 DWORD dw = GetLastError();
214
215 FormatMessage(
216 FORMAT_MESSAGE_ALLOCATE_BUFFER |
217 FORMAT_MESSAGE_FROM_SYSTEM |
218 FORMAT_MESSAGE_IGNORE_INSERTS,
219 nullptr,
220 dw,
221 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
222 (LPTSTR) &lpMsgBuf,
223 0, nullptr );
224
225 std::string errMsg((LPCTSTR)lpMsgBuf);
226
227 LocalFree(lpMsgBuf);
228
229 return errMsg;
230#endif
231}
232
233MITKCPPMICROSERVICES_EXPORT ::std::string GetDemangledName(const ::std::type_info& typeInfo)
234{

Callers 4

LoadMethod · 0.70
UnloadMethod · 0.70
load_implFunction · 0.70
WaitMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected