Back to the WFC main page

CEventLogRecord : CObject

$Revision: 19 $

Description

This class makes it easy to deal with Event Log records. It is patterened after the EVENTLOGRECORD data structure.

Data Members

ComputerName
Name of the computer where the event occured.
Source
Name of the application that generated the event.
RecordNumber
Number of the record.
Reserved
A special field that Microsoft doesn't know what to do with.
TimeGenerated
Time when the event occured.
TimeWritten
Time when the event was written.
EventID
ID of the event.
EventType
Type of event.
EventCategory
The category of event.
PairedEventFlags
Flags.
ClosingRecordNumber
Used in paired events.
UserSID
The user's SID.
Data
Any data that was written with the event.
Strings
String data associated with the event.

Methods

Compare
Compares this object with another one.
Copy
Copies another CEventLogRecord or a EVENTLOGRECORD.
Empty
Sets all data members to an initial state.
Serialize
After all, we are a CObject...

Example

#include <wfc.h>

void test_CEventLog( void )
{
   WFCTRACEINIT( TEXT( "test_CEventLog()" ) );

   CEventLog log;

   if ( log.Open( TEXT( "WFC" ) ) == FALSE )
   {
      WFCTRACE( TEXT( "Can't Open WFC event log because" ) );
      WFCTRACEERROR( log.GetErrorCode() );
   }

   if ( log.RegisterSource( TEXT( "WFC" ) ) == FALSE )
   {
      WFCTRACE( TEXT( "Can't Open WFC event log because" ) );
      WFCTRACEERROR( log.GetErrorCode() );
   }

   CEventLogRecord record;

   DWORD loop_index = 0;

   while( log.Read( loop_index, record ) != FALSE )
   {
#if defined( _DEBUG )
      record.Dump( afxDump );
#endif // _DEBUG
      loop_index++;
   }

}

Copyright, 2000, Samuel R. Blackburn
$Workfile: CEventLogRecord.CPP $
$Modtime: 1/04/00 5:11a $