5 #include "Windows/Error.h"
7 #include "Common/StringConvert.h"
17 bool MyFormatMessage(DWORD messageID, CSysString &message)
20 if(::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
21 FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
22 NULL,messageID, 0, (LPTSTR) &msgBuf,0, NULL) == 0)
24 message = (LPCTSTR)msgBuf;
30 bool MyFormatMessage(DWORD messageID, UString &message)
35 if(::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
36 FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
37 NULL, messageID, 0, (LPWSTR) &msgBuf, 0, NULL) == 0)
39 message = (LPCWSTR)msgBuf;
43 CSysString messageSys;
44 bool result = MyFormatMessage(messageID, messageSys);
45 message = GetUnicodeString(messageSys);