mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 12:23:41 +00:00
[NOTEPAD] Display error code if no error string is available (#7319)
This commit is contained in:
parent
da26ec3465
commit
d9afe73de4
1 changed files with 7 additions and 1 deletions
|
@ -49,6 +49,7 @@ VOID ShowLastError(VOID)
|
|||
{
|
||||
LPTSTR lpMsgBuf = NULL;
|
||||
TCHAR szTitle[MAX_STRING_LEN];
|
||||
TCHAR szFallback[42], *pszMessage = szFallback;
|
||||
|
||||
LoadString(Globals.hInstance, STRING_ERROR, szTitle, _countof(szTitle));
|
||||
|
||||
|
@ -60,7 +61,12 @@ VOID ShowLastError(VOID)
|
|||
0,
|
||||
NULL);
|
||||
|
||||
MessageBox(Globals.hMainWnd, lpMsgBuf, szTitle, MB_OK | MB_ICONERROR);
|
||||
if (lpMsgBuf)
|
||||
pszMessage = lpMsgBuf;
|
||||
else
|
||||
wsprintfW(szFallback, L"%d", error);
|
||||
|
||||
MessageBox(Globals.hMainWnd, pszMessage, szTitle, MB_OK | MB_ICONERROR);
|
||||
LocalFree(lpMsgBuf);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue