void ShowLastError(int ErrorID = GetLastError())
{
char buff[128] = "";
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,NULL,ErrorID,\
LANG_NEUTRAL,buff,sizeof(buff),NULL);
printf("Error:%s\n", buff); //Console App
MessageBox(0, buff, "Error", 0); //Windows App
}
使用FormatMessage得到GetLastError()的詳細信息
最新推荐文章于 2019-04-29 10:28:20 发布