windows下所有出错信息。

#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
int errnumer=0;
//cin>>errnumer;



for(int i = 1 ; i<13000 ;i++)
{
LPVOID lpMsgBuf;

FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
i,
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
if(lpMsgBuf==0)
{
//cout << "NONE" << endl;
continue;
}
cout << i << " : " << (char*)lpMsgBuf ;

LocalFree( lpMsgBuf );
}
return 0;
}

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