Source code of Windows XP (NT5)
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

  1. #include "stdafx.h"
  2. #include "vStandard.h"
  3. VWCL_API int VShowLastErrorMessage(HWND hWndParent)
  4. {
  5. TCHAR szString[4096] = {_T('\0')};
  6. DWORD dwLastError = GetLastError();
  7. if ( dwLastError )
  8. FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM,
  9. NULL,
  10. dwLastError,
  11. MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
  12. szString,
  13. sizeof(szString)/sizeof(TCHAR),
  14. NULL);
  15. if ( szString[0] != _T('\0') )
  16. {
  17. #ifdef _CONSOLE
  18. ODS(szString);
  19. #else
  20. #ifdef VGetAppTitle
  21. return MessageBox(hWndParent, szString, VGetAppTitle(), MB_ICONINFORMATION);
  22. #else
  23. return MessageBox(hWndParent, szString, _T("DEBUG MESSAGE"), MB_ICONINFORMATION);
  24. #endif
  25. #endif
  26. }
  27. return IDOK;
  28. }