Click here to Skip to main content
15,895,256 members
Articles / Desktop Programming / MFC

Event Logging in Windows 2000

Rate me:
Please Sign up or sign in to vote.
4.72/5 (14 votes)
30 May 20028 min read 181.3K   3.3K   51  
Sample code for performing event logging that is accessible from Event Viewer
//
//  Values are 32 bit values layed out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +---+-+-+-----------------------+-------------------------------+
//  |Sev|C|R|     Facility          |               Code            |
//  +---+-+-+-----------------------+-------------------------------+
//
//  where
//
//      Sev - is the severity code
//
//          00 - Success
//          01 - Informational
//          10 - Warning
//          11 - Error
//
//      C - is the Customer code flag
//
//      R - is a reserved bit
//
//      Facility - is the facility code
//
//      Code - is the facility's status code
//
//
// Define the facility codes
//


//
// Define the severity codes
//


//
// MessageId: EVTTST_CATEGORY
//
// MessageText:
//
//  Test Category
//
#define EVTTST_CATEGORY                  0x00000001L

//
// MessageId: EVTTST_MESSAGE
//
// MessageText:
//
//  This Message came from the Message File
//  %1
//  %2
//
#define EVTTST_MESSAGE                   0x00000064L

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions