Guest User

Untitled

a guest
May 17th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. QString WindowsUtils::formatMessage(unsigned long msg){
  2.     const DWORD size = 1024;
  3.     WCHAR buffer[size];
  4.     qDebug() << "status: " << msg;
  5.     DWORD res = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK, 0, msg, 0, buffer, size, 0);
  6.     if (res == NULL){
  7.         alLog(QString("FormatMessage failed : %1").arg(GetLastError()));
  8.     }
  9.     return QTBASE_TCHAR_TO_QSTRING(buffer);
  10. }
Add Comment
Please, Sign In to add comment