问题描述
我创建了一个.mc文件来定义事件ID的一些描述,如下所示:
I've created a .mc file to define some descriptions for Event ID, as shown below:
https://imgur.com/a/9HP4Vhr
https://imgur.com/a/9HP4Vhr
然后我使用mc.exe获取.h和.rc文件。然后.rc文件由rc.exe编译生成.res文件。
Then I used mc.exe to obtain a .h and .rc files. The .rc file then compiled by rc.exe to generate the .res file.
将.res文件作为EventMessageFile链接到.dll文件后,我将.h文件作为我的项目中的头文件(在事件查看器中打印事件日志)。
After linking the .res file to a .dll file as the EventMessageFile, I put the .h file as a header file in my project(printing Event Log in the Event Viewer).
但我仍然从系统收到这些消息,无法找到事件ID的描述,如下所示:
But I still got these messages from the system that the description of the Event ID cannot be found, as shown below :
https://imgur.com/a/G9oRVSq
https://imgur.com/a/G9oRVSq
有谁知道如何解决这个问题?
Does anyone know how to resolve this problem?
非常感谢任何建议!
谢谢!
Ben
推荐答案
感谢您在此发帖。
>>事件日志无法找到事件ID的描述
您是否检查过是否有注册事件源是否正确?
Have you checked if you have registered the event source correct?
根据文件,如果申请在调用RegisterEventSource并传递在注册表中找不到的源名称时,事件日志记录服务默认使用应用程序日志。但是,由于没有消息文件,事件查看器不能
将任何事件标识符或事件类别映射到描述字符串,并将显示错误。因此,您应该为应用程序的注册表添加一个唯一的事件源,并指定一个消息文件。
According to this document, if the application calls RegisterEventSource and passes a source name that cannot be found in the registry, the event-logging service uses the Application log by default. However, because there are no message files, the Event Viewer cannot map any event identifiers or event categories to a description string, and will display an error. For this reason, you should add a unique event source to the registry for your application and specify a message file。
我建议您按照下面的文档查看哪一步出错。
I suggest you follow this document below and check which step goes wrong.
最诚挚的问候,
Baron Bi
这篇关于事件日志无法找到事件ID的描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!