Platform SDK: Debugging and Error Handling |
The OpenEventLog function opens a handle to an event log.
HANDLE OpenEventLog( LPCTSTR lpUNCServerName, // server name LPCTSTR lpSourceName // file name );
If the function succeeds, the return value is the handle to an event log.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
To close the handle to the event log, use the CloseEventLog function.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Event Logging Overview, Event Logging Functions, ClearEventLog, CloseEventLog, GetNumberOfEventLogRecords, GetOldestEventLogRecord, ReadEventLog, ReportEvent