Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.35 KB

GetNumberOfEventLogRecords.md

File metadata and controls

66 lines (45 loc) · 1.35 KB

Home

Function name : GetNumberOfEventLogRecords

Group: Event Logging - Library: advapi32


Retrieves the number of records in the specified event log.


Code examples:

Reading entries from Event logs
Writing entries to custom Event Log

Declaration:

BOOL GetNumberOfEventLogRecords(
	HANDLE hEventLog,
	PDWORD NumberOfRecords
);  

FoxPro declaration:

DECLARE INTEGER GetNumberOfEventLogRecords IN advapi32;
	INTEGER hEventLog,;
	LONG @NumberOfRecords  

Parameters:

hEventLog [in] A handle to the open event log. This handle is returned by the OpenEventLog or OpenBackupEventLog function.

NumberOfRecords [out] A pointer to a variable that receives the number of records in the specified event log.


Return value:

If the function succeeds, the return value is nonzero.


Comments:

hLog = OpenEventLog(NULL, "Application")  
  
IF hLog <> 0  
	STORE 0 TO nReccount, nRecno  
  
	= GetNumberOfEventLogRecords(m.hLog, @nReccount)  
	= GetOldestEventLogRecord(m.hLog, @nRecno)  
  
	? nReccount, nRecno  
  
	= CloseEventLog(hLog)  
ENDIF