当我执行以下代码片段时,它失败并显示错误代码 317。如何解决问题?我们正在为项目使用 Unicode 字符集
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 )
最佳答案
使用错误码查找tool在 Visual Studio 中,317 被描述为
The system cannot find message text for message number 0x%1 in the message file for %2.
这意味着系统中不存在针对先前错误代码的消息描述。 FormatMessage 的 MSDN 文档带有标志 FORMAT_MESSAGE_FROM_SYSTEM
的声明:
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.
关于c++ - FormatMessage 失败,错误代码为 317,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6264449/