使用 Visual Studio C 编写 Windows 事件日志6
我正在尝试使用 VC++6 编写一个简单的函数来写入事件日志。它必须位于此版本的 studio 中,因为它被添加到旧应用程序中。我遇到的问题是它写的消息类似于下面的内容。这里唯一有效的是“This is a test”字符串。我不需要这太复杂。我只需要能够写入特定应用程序的事件日志。有什么想法吗?我看过一些文章,但它们似乎比我需要的要多得多。
找不到源应用程序中事件 ID 3 的描述。您的本地计算机上未安装引发此事件的组件,或者安装已损坏。您可以在本地计算机上安装或修复该组件。
如果事件源自另一台计算机,则显示信息必须与事件一起保存。
事件中包含以下信息:
这是一个测试,
消息资源存在,但在字符串/消息表中未找到消息
I am attempting to write a simple function using VC++6 to write to the event log. It must be in this version of studio because it is being added to a legacy application. The problem that I am having is that it writes the message similar to below. The only thing that is valid here is the "This is a test" string. I don't need this to be very complicated. I just need to be able to write to the event log for a specific application. Any thoughts? I have seen a few articles but they appear to be a lot more than I need.
The description for Event ID 3 from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
This is a test
the message resource is present but the message is not found in the string/message table
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已经过去很长一段时间了,但我似乎记得您可能需要创建一个“消息资源 Dll”来解决此问题。或者至少在某处有一些消息资源。
这篇文章似乎可能会有所帮助(并且它支持 VC6): 在您自己的项目中使用 MC.exe、消息资源和 NT 事件日志
It's been a very long time, but I seem to remember that you might need to create a *Message Resource Dll" to fix this. Or at least have some message resources somewhere.
This article seems like it might be able to help (and it support VC6): Using MC.exe, message resources and the NT event log in your own projects