c++ - FormatMessage 失败,错误代码为 317

标签 c++ visual-c++ windows-ce

当我执行以下代码片段时,它失败并显示错误代码 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/

相关文章:

c++ - 滚动后 MFC 控件消失

c++ - 如何在另一个命名空间中使用常量定义的外部?

C++电话号码程序

windows-ce - 如何 : Platform builder for windows CE 6. 0

c++ - 使用 regsvr32 时在 Windows dll 中找不到入口点

windows - CoInitializeSecurity 错误

c# - CE 设备重启后主窗体随机消失

c++ - defaultUserNotificationCenter 在 C++ 中导致 'unrecognized selector' 错误

c++ - Kd-Tree 有缺陷的 K 最近邻

c++ - 如何在 C++ 中编写正确的哈希表析构函数