码迷,mamicode.com
首页 > 其他好文 > 详细

FormatMessage 错误消息

时间:2014-11-01 21:37:57      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   io   color   for   sp   div   on   

 1     // Get the error code
 2     DWORD dwError = GetDlgItemInt(IDC_EDIT1);
 3 
 4     HLOCAL hlocal = NULL;   // Buffer that gets the error message string
 5 
 6     // Use the default system locale since we look for Windows messages.
 7     // Note: this MAKELANGID combination has 0 as value
 8     DWORD systemLocale = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
 9 
10     // Get the error code‘s textual description
11     BOOL fOk = FormatMessage(
12         FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
13         FORMAT_MESSAGE_ALLOCATE_BUFFER,
14         NULL, dwError, systemLocale,
15         (PTSTR) &hlocal, 0, NULL);
16 
17     SetDlgItemText(IDC_TEXTOUT,(PTSTR) LocalLock(hlocal));

 

FormatMessage 错误消息

标签:des   style   blog   io   color   for   sp   div   on   

原文地址:http://www.cnblogs.com/whypro/p/4067700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!