打印出 GetLastError 的文本含义。

void GetLastErrorEx() { DWORD dwMessageID = ::GetLastError(); TCHAR *szMessage = NULL; TCHAR szTitle[32] = {0}; ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwMessageID, 0, (LPWSTR) &szMessage, 0, NULL); _stprintf(szTitle, _T("::GetLastError() = %d"), dwMessageID); ::MessageBox(NULL, szMessage, szTitle, MB_OK); }

你可能感兴趣的:(null,System,buffer)