Event log: The description for event in source cannot be found

You often see this message in the event viewer when you use a new source / message id.
To solve this, we need to create a Event Message File which will store the required information of how to display this message.
Open regedit and navigate to:

Create or open the source you would like to use.
Notice that every source has an Event Message File associated with it:
Now let's create our own Event Message File
Open with notepad a new file with .mc extension, e.g example.mc
Write this content:

SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS               Informational=0x1:STATUS_SEVERITY_INFORMATIONAL               Warning=0x2:STATUS_SEVERITY_WARNING               Error=0x3:STATUS_SEVERITY_ERROR              );;

FacilityNames=(System=0x0:FACILITY_SYSTEM               Runtime=0x2:FACILITY_RUNTIME               Stubs=0x3:FACILITY_STUBS               Io=0x4:FACILITY_IO_ERROR_CODE              );;

LanguageNames=(English=0x409:MSG00409)
MessageId=311
Severity=Success
Facility=System
SymbolicName=GENERAL_MESSAGE
Language=English%1.
Use the "mc" tool that comes with visual studio to generate an rc file.
mc.exe example.mc 
Create a resource file with the "rc" tool.
rc.exe /r example.rc
link -dll -noentry -out:example.dll example.res
Write this file location in the registry.


Post a Comment

Previous Post Next Post