Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OW32::CEventLog Class Reference

NT event log wrapper. More...

#include <EventLog.h>

List of all members.

Public Member Functions

 CEventLog ()
 Default constructor.
 ~CEventLog ()
 Tidy the event log if opened.
BOOL Open (LPCTSTR SourceName, LPCTSTR Computer=NULL)
 Open the event log for writing.
void Close ()
 Close the event log.
BOOL ReportEvent (WORD wType, DWORD dwEventID, WORD wCategory=0, WORD wNumStrings=0, LPCTSTR *lpStrings=NULL, DWORD dwDataSize=0, LPVOID lpRawData=NULL, PSID lpUserSID=NULL)
 Write an event to the event log.
BOOL ReportInformation (DWORD dwEventID, LPCTSTR str1=0, LPCTSTR str2=0, LPCTSTR str3=0, LPCTSTR str4=0)
 Write an information event with no category to the event log.
BOOL ReportWarning (DWORD dwEventID, LPCTSTR str1=0, LPCTSTR str2=0, LPCTSTR str3=0, LPCTSTR str4=0)
 Write an warning event with no category to the event log.
BOOL ReportError (DWORD dwEventID, LPCTSTR str1=0, LPCTSTR str2=0, LPCTSTR str3=0, LPCTSTR str4=0)
 Write an error event with no category to the event log.
BOOL ReportAPIError (DWORD dwEventID, DWORD dwErr, LPCTSTR str1=0, LPCTSTR str2=0, LPCTSTR str3=0)
 Write an Win32 API error message event with no category to the event log.

Static Public Member Functions

LONG RegisterMessageDLL (LPCTSTR SourceName, LPCTSTR MessageDLLPath=NULL, HMODULE hModule=NULL, DWORD TypesSupported=EVENTLOG_ERROR_TYPE|EVENTLOG_WARNING_TYPE|EVENTLOG_INFORMATION_TYPE)
 Register a message DLL for the given event source/types. If the message DLL path is not supplied then the name of the current module is used.
LONG UnregisterMessageDLL (LPCTSTR SourceName)
 Unregister the message DLL(s) for the named source.


Detailed Description

NT event log wrapper.


Member Function Documentation

BOOL OW32::CEventLog::Open LPCTSTR  SourceName,
LPCTSTR  Computer = NULL
[inline]
 

Open the event log for writing.

Parameters:
SourceName the name of the source to use
Computer the computer to open the event log on
Returns:
TRUE if successful, FALSE otherwise

LONG OW32::CEventLog::RegisterMessageDLL LPCTSTR  SourceName,
LPCTSTR  MessageDLLPath = NULL,
HMODULE  hModule = NULL,
DWORD  TypesSupported = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE
[inline, static]
 

Register a message DLL for the given event source/types. If the message DLL path is not supplied then the name of the current module is used.

Parameters:
SourceName the name of the source to register
MessageDLLPath the path to the DLL containing message strings, defaults to the current module
hModule Optional: a handle to a module from which the MessageDLLPath can be deduced. MessageDLLPath must be null.
TypesSupported The type of information that the message DLL contains information for, defaults to all types.
Returns:
Win32 error code indicating success or failure.

BOOL OW32::CEventLog::ReportAPIError DWORD  dwEventID,
DWORD  dwErr,
LPCTSTR  str1 = 0,
LPCTSTR  str2 = 0,
LPCTSTR  str3 = 0
[inline]
 

Write an Win32 API error message event with no category to the event log.

Parameters:
dwEventID The message table ID of the event
dwErr The error code to log
Returns:
TRUE if successful, FALSE otherwise

BOOL OW32::CEventLog::ReportError DWORD  dwEventID,
LPCTSTR  str1 = 0,
LPCTSTR  str2 = 0,
LPCTSTR  str3 = 0,
LPCTSTR  str4 = 0
[inline]
 

Write an error event with no category to the event log.

Parameters:
dwEventID The message table ID of the event
str1 An optional extra string
str2 An optional extra string
str3 An optional extra string
str4 An optional extra string
Returns:
TRUE if successful, FALSE otherwise

BOOL OW32::CEventLog::ReportEvent WORD  wType,
DWORD  dwEventID,
WORD  wCategory = 0,
WORD  wNumStrings = 0,
LPCTSTR *  lpStrings = NULL,
DWORD  dwDataSize = 0,
LPVOID  lpRawData = NULL,
PSID  lpUserSID = NULL
[inline]
 

Write an event to the event log.

Parameters:
wType The type of the event (success, error, etc).
dwEventID The message table ID of the event
wCategory Category, defaults to `None'
wNumStrings The number of string parameters.
lpStrings The strings
dwDataSize The size of the raw data to log
lpRawData The raw data to log
lpUserSID The user's SID for logging the user name
Returns:
TRUE if successful, FALSE otherwise

BOOL OW32::CEventLog::ReportInformation DWORD  dwEventID,
LPCTSTR  str1 = 0,
LPCTSTR  str2 = 0,
LPCTSTR  str3 = 0,
LPCTSTR  str4 = 0
[inline]
 

Write an information event with no category to the event log.

Parameters:
dwEventID The message table ID of the event
str1 An optional extra string
str2 An optional extra string
str3 An optional extra string
str4 An optional extra string
Returns:
TRUE if successful, FALSE otherwise

BOOL OW32::CEventLog::ReportWarning DWORD  dwEventID,
LPCTSTR  str1 = 0,
LPCTSTR  str2 = 0,
LPCTSTR  str3 = 0,
LPCTSTR  str4 = 0
[inline]
 

Write an warning event with no category to the event log.

Parameters:
dwEventID The message table ID of the event
str1 An optional extra string
str2 An optional extra string
str3 An optional extra string
str4 An optional extra string
Returns:
TRUE if successful, FALSE otherwise

LONG OW32::CEventLog::UnregisterMessageDLL LPCTSTR  SourceName  )  [inline, static]
 

Unregister the message DLL(s) for the named source.

Parameters:
SourceName the name of the source to register
Returns:
Win32 error code indicating success or failure.


The documentation for this class was generated from the following file:
Generated on Sun Jun 5 01:29:24 2005 for OW32 by  doxygen 1.3.9.1