Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
Release 5
-
None
Description
When writing messages via logMessage, then the Windows Event Viewer usually displays:
The description for Event ID ( 0 ) in Source (...) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: [actual message]
To avoid that, and to only have the message itself displayed, the following steps have to be taken:
a) Create a dummy.mc file like this:
LanguageNames=(English=0x409:MSG00409)
MessageId=0x1
Severity=Error
SymbolicName=MSG_BAD_COMMAND
Language=English
%1
.
b) Compile that dummy.mc file into a resource file:
mc dummy.mc
c) Add the resource file to your project:
RC_FILE = dummy.rc
d) Register the service executable as the message source by adding a registry key:
HKLM/System/CurrentControlSet/Services/Eventlog/Application/[Service Name]/EventMessageFile
That entry needs to point to the executable.
Steps a/b/c could be handled by the service.pri file. Step d could be performed by the service's self-installing routine.