MCPcopy Create free account
hub / github.com/WinMerge/winmerge / GetSysError

Function GetSysError

Src/MergeApp.cpp:9–32  ·  view source on GitHub ↗

Get user language description of error, if available

Source from the content-addressed store, hash-verified

7
8// Get user language description of error, if available
9String GetSysError(int nerr /* =-1 */)
10{
11 if (nerr == -1)
12 nerr = GetLastError();
13 LPVOID lpMsgBuf;
14 String str = _T("?");
15 if (FormatMessage(
16 FORMAT_MESSAGE_ALLOCATE_BUFFER |
17 FORMAT_MESSAGE_FROM_SYSTEM |
18 FORMAT_MESSAGE_IGNORE_INSERTS,
19 nullptr,
20 nerr,
21 0, // Default language
22 (tchar_t*) &lpMsgBuf,
23 0,
24 nullptr
25 ))
26 {
27 str = (const tchar_t*)lpMsgBuf;
28 // Free the buffer.
29 LocalFree( lpMsgBuf );
30 }
31 return str;
32}
33
34/**
35 * @brief Get Options Manager.

Callers 10

SaveFileMethod · 0.70
GenerateReportMethod · 0.70
GetContextRegValuesMethod · 0.70
SaveMergePathMethod · 0.70
OnDeleteCurrentSchemeMethod · 0.70
SaveToFileMethod · 0.70
DoFileSaveMethod · 0.70
DoFileSaveAsMethod · 0.70
GenerateReportMethod · 0.70
GenerateReportMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected