MCPcopy Create free account
hub / github.com/Meowmycks/LetMeowIn / GetLastErrorMessage

Function GetLastErrorMessage

src/main.cpp:110–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110std::wstring GetLastErrorMessage() {
111 DWORD errorCode = GetLastError();
112 LPWSTR errorMessage = nullptr;
113
114 FormatMessageW(
115 FORMAT_MESSAGE_ALLOCATE_BUFFER |
116 FORMAT_MESSAGE_FROM_SYSTEM |
117 FORMAT_MESSAGE_IGNORE_INSERTS,
118 nullptr, errorCode, 0,
119 reinterpret_cast<LPWSTR>(&errorMessage), 0, nullptr);
120
121 if (errorMessage != nullptr) {
122 std::wstring errorMsg(errorMessage);
123 LocalFree(errorMessage);
124 return errorMsg;
125 }
126 else {
127 return L"Failed to retrieve error message.";
128 }
129}
130
131template<typename StringType, size_t N>
132StringType unASCIIme(const int(&ascii_values)[N]) {

Callers 2

WeHaveTheChatLogsHereFunction · 0.85
InvokeMiniDumpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected