I have a set of C++ applications that all use a common message DLL. I am
working on a .NET Service that I would also like to use this same message
DLL.
From what I have read, this should work properly:
System.Diagnostics.EventLog.WriteEntry("MySource", "My Message",
EventLogEntryType.Information, 100, 9);
where I want the severity to be Information, the message Event ID in my
custom message DLL to be 100, and the category (also from my custom message
DLL) to be 9.
However, it doesn't work properly -- it doesn't seem to be able to look up
the message text by the Event ID. The event that shows up in the event log
looks right in the event list -- it is an Information message, from source
"MySource" (it's even in the custom Event Log used by this event source --
we're not using Application for these apps). The Category is the correct
name for category #9 in my custom message file, and the event number shows
up in the list as 100. All's well so far.
But when I bring up the event itself to get the message, I get:
The description for Event ID ( 100 ) in Source ( MySource ) cannot be found.
The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: My
Message.
This is exactly what would happen in the C++ apps if the Event ID specified
wasn't in the message file. Except in this case, that Event ID is
absolutely in the message file, I can use that event in any of my C++ apps
without problem -- so the message file in this case is not the problem.
Any ideas on why it can find everything ELSE from my message file, but not
the message itself? It finds the category, it finds the source in the
correct custom Event Log, it just can't find the message.
Thanks,
Steve