mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[MPLAY32]: Improve ShowLastWin32Error().
svn path=/trunk/; revision=63960
This commit is contained in:
parent
104275db8c
commit
2ee074752d
1 changed files with 11 additions and 5 deletions
|
@ -88,13 +88,19 @@ void ResizeClientArea(HWND hwnd, int nWidth, int nHeight)
|
|||
static VOID
|
||||
ShowLastWin32Error(HWND hwnd)
|
||||
{
|
||||
DWORD dwError;
|
||||
LPTSTR lpMessageBuffer;
|
||||
DWORD dwError = GetLastError();
|
||||
|
||||
dwError = GetLastError();
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, 0, (LPWSTR)&lpMessageBuffer, 0, NULL);
|
||||
MessageBox(hwnd, lpMessageBuffer, szAppTitle, MB_OK | MB_ICONERROR);
|
||||
LocalFree(lpMessageBuffer);
|
||||
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
dwError,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&lpMessageBuffer,
|
||||
0, NULL) != 0)
|
||||
{
|
||||
MessageBox(hwnd, lpMessageBuffer, szAppTitle, MB_OK | MB_ICONERROR);
|
||||
if (lpMessageBuffer) LocalFree(lpMessageBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
static VOID
|
||||
|
|
Loading…
Reference in a new issue