FormatMessage失败,错误代码317

编程入门 行业动态 更新时间:2024-10-24 18:18:05
本文介绍了FormatMessage失败,错误代码317的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我执行以下代码段时,它会失败,并显示 错误代码317 。如何解决这个问题?我们为项目使用Unicode字符集

char * pszMessgeBuffer = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorId, 0,//默认语言(LPTSTR) ; pszMessgeBuffer, 0, NULL)

解决方案>

使用错误代码查找工具 Studio,317被描述为

系统找不到消息文本消息号为0x%1的消息文件为%2。

这意味着系统中不存在上一个错误代码的消息描述。 FormatMessage 的MSDN文档,标志 FORMAT_MESSAGE_FROM_SYSTEM 说明:

不是所有基于Windows Embedded CE的设备都包含系统 message-table资源。这是Windows 嵌入式CE操作系统的一个可选部分,而且经常被删除以节省空间。

When I executed the following code piece it fails with error code 317. How can solve the issue? We are using Unicode Character Set for the project

char* pszMessgeBuffer = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorId, 0, // Default language (LPTSTR) &pszMessgeBuffer, 0, NULL )

解决方案

Using the error code lookup tool from Visual Studio, 317 is described as

The system cannot find message text for message number 0x%1 in the message file for %2.

This means that a message description does not exist in the system for the previous error code. The MSDN documentation for FormatMessage with flag FORMAT_MESSAGE_FROM_SYSTEM states that:

Not all Windows Embedded CE–based devices will contain the system message-table resources. This is a selectable part of the Windows Embedded CE operating system and is often removed to conserve space.

更多推荐

FormatMessage失败,错误代码317

本文发布于:2023-11-06 01:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562370.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误代码   FormatMessage

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!