Currently I have a resource file that I use for my custom created event log. Everything seems to work perfectly when I write an event to the log with intentions of informational/success purposes. But when I write one of an Error intent I get...
The description for Event ID 301 from source X cannot be found...
I was wondering... Does it have to do with the fact that all my categories are Severity=Success? Do I also need a category for Service that has Severity=Error?
Example of successful log entry:
Event ID: 101, Level: Information, Task Category: (8) Service
Example of NON successful log entry:
Event ID: 301, Level: Error, Task Category: (8) Service
The following is my current text message file that I convert into a resource file for categories, and messages...
; // EventLogMsgs.mc
; // ********************************************************
; // Use the following commands to build this file:
; // mc -s EventLogMsgs.mc
; // rc EventLogMsgs.rc
; // link /DLL /SUBSYSTEM:WINDOWS /NOENTRY /MACHINE:x86 EventLogMsgs.Res
; // ********************************************************
; // - Event categories -
; // Categories must be numbered consecutively starting at 1.
; // ********************************************************
MessageId=0x1
Severity=Success
SymbolicName=GENERAL_CATEGORY
Language=English
General
.
MessageId=0x2
Severity=Success
SymbolicName=DATABASE_CATEGORY
Language=English
Database Query
.
MessageId=0x3
Severity=Success
SymbolicName=LOGON_CATEGORY
Language=English
Logon
.
MessageId=0x4
Severity=Success
SymbolicName=LOGOFF_CATEGORY
Language=English
Logoff
.
MessageId=0x5
Severity=Success
SymbolicName=EMAIL_CATEGORY
Language=English
Email
.
MessageId=0x6
Severity=Success
SymbolicName=PRINTER_CATEGORY
Language=English
Printer
.
MessageId=0x7
Severity=Success
SymbolicName=IO_CATEGORY
Language=English
IO
.
MessageId=0x8
Severity=Success
SymbolicName=SERVICE_CATEGORY
Language=English
Service
.
MessageId=0x9
Severity=Success
SymbolicName=DEBUG_CATEGORY
Language=English
Debug
.
; // - Event messages -
; // *********************************
MessageId = 100
Severity = Success
Facility = Application
SymbolicName = SMESSAGE_ID100
Language=English
%1
.
MessageId = 101
Severity = Success
Facility = Application
SymbolicName = SMESSAGE_ID101
Language=English
%1
.
MessageId = 102
Severity = Success
Facility = Application
SymbolicName = SMESSAGE_ID102
Language=English
%1
.
MessageId = 103
Severity = Success
Facility = Application
SymbolicName = SMESSAGE_ID103
Language=English
%1
.
MessageId = 104
Severity = Success
Facility = Application
SymbolicName = SMESSAGE_ID104
Language=English
%1
.
MessageId = 105
Severity = Success
Facility = Application
SymbolicName = SMESSAGE_ID105
Language=English
%1
.
MessageId = 200
Severity = Warning
Facility = Application
SymbolicName = WMESSAGE_ID200
Language=English
%1
.
MessageId = 201
Severity = Warning
Facility = Application
SymbolicName = WMESSAGE_ID201
Language=English
%1
.
MessageId = 202
Severity = Warning
Facility = Application
SymbolicName = WMESSAGE_ID202
Language=English
%1
.
MessageId = 203
Severity = Warning
Facility = Application
SymbolicName = WMESSAGE_ID203
Language=English
%1
.
MessageId = 204
Severity = Warning
Facility = Application
SymbolicName = WMESSAGE_ID204
Language=English
%1
.
MessageId = 205
Severity = Warning
Facility = Application
SymbolicName = WMESSAGE_ID205
Language=English
%1
.
MessageId = 300
Severity = Error
Facility = Application
SymbolicName = EMESSAGE_ID300
Language=English
%1
.
MessageId = 301
Severity = Error
Facility = Application
SymbolicName = EMESSAGE_ID301
Language=English
%1
.
MessageId = 302
Severity = Error
Facility = Application
SymbolicName = EMESSAGE_ID302
Language=English
%1
.
MessageId = 303
Severity = Error
Facility = Application
SymbolicName = EMESSAGE_ID303
Language=English
%1
.
MessageId = 304
Severity = Error
Facility = Application
SymbolicName = EMESSAGE_ID304
Language=English
%1
.
MessageId = 305
Severity = Error
Facility = Application
SymbolicName = EMESSAGE_ID305
Language=English
%1
.
Actual Problem: I was creating the file wrong and the event numbers I thought I was creating we infact different number. I found out what was going on after digging into the myfile.c file produced when running the mc.exe and rc.exe commands. When looking at that file I realized that the DWORD values (HEX) did not add up to the integer I expected.
My Issue: The bottom line was my issue was simply because I used "Severity = Warning" on #200 rather than "Severity = Success". When I changed that I finally got the event numbers I was looking for being created. There were a few other enhancements I made to my file (as seen below) but that was the main reason I had my issue.
Corrected Eventlog Message File: Below, you will find my correct eventlog message file. I also decided to break it up into two files keeping the Categories and Events separate. (You don't have to)
categories.mc
events.mc