首页 > 代码库 > FormatMessage 错误消息
FormatMessage 错误消息
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 description11 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 错误消息
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。