mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
706 B
33 lines
706 B
#include "stdafx.h"
|
|
#include "vStandard.h"
|
|
|
|
VWCL_API int VShowLastErrorMessage(HWND hWndParent)
|
|
{
|
|
TCHAR szString[4096] = {_T('\0')};
|
|
DWORD dwLastError = GetLastError();
|
|
|
|
if ( dwLastError )
|
|
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM,
|
|
NULL,
|
|
dwLastError,
|
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
|
szString,
|
|
sizeof(szString)/sizeof(TCHAR),
|
|
NULL);
|
|
|
|
if ( szString[0] != _T('\0') )
|
|
{
|
|
#ifdef _CONSOLE
|
|
ODS(szString);
|
|
#else
|
|
#ifdef VGetAppTitle
|
|
return MessageBox(hWndParent, szString, VGetAppTitle(), MB_ICONINFORMATION);
|
|
#else
|
|
return MessageBox(hWndParent, szString, _T("DEBUG MESSAGE"), MB_ICONINFORMATION);
|
|
#endif
|
|
#endif
|
|
}
|
|
|
|
return IDOK;
|
|
}
|
|
|