Eventlog issues still 
This works good, unfortunately I don't understand C++ well, suspecting a pointer to
the TYPE EVENTLOGRECORD is going to be needed.
All functions return correctly except "ReadEventLog"....
------------------
Scott

This works good, unfortunately I don't understand C++ well, suspecting a pointer to
the TYPE EVENTLOGRECORD is going to be needed.
All functions return correctly except "ReadEventLog"....
Code:
lpSourceName = "Application" ' 'Security, System hEventLog = OpenEventLog("",lpSourceName) If IsFalse hEventLog Then MsgBox "Could not read the event log",%MB_ICONSTOP,"Error reading event log" Exit Function End If lResult = GetNumberOfEventLogRecords(hEventLog, lEventLogRecordCount) lResult = GetOldestEventLogRecord(ByVal hEventLog, lpOldestRecord) ' ' ' For lLoop = 1 To lEventLogRecordCount lResult = ReadEventLog(ByVal hEventLog, _ ByVal %EVENTLOG_SEEK_READ Or %EVENTLOG_SEQUENTIAL_READ, _ ByVal 0, _ lpBuffer,_ ByVal SizeOf(lpBuffer),_ pnBytesRead, _ pnMinNumberOfBytesNeeded) If lLoop = 1 Then MsgBox Format$(lpBuffer.eventid) Next lResult = CloseEventLog(ByVal hEventLog) ' ' ' ' ' ' ' Now hte C++ portion of it......(Thanks Ron!!) pevlr = (EVENTLOGRECORD *) &bBuffer; // Opening the event Log positions the file pointer For this // Handle At the beginning of the log. Read the records // sequentially Until there are no more. While (ReadEventLog(h, // event Log Handle EVENTLOG_FORWARDS_READ | // reads forward EVENTLOG_SEQUENTIAL_READ, // sequential Read 0, // ignored For sequential reads pevlr, // pointer To buffer BUFFER_SIZE, // Size of buffer &dwRead, // number of bytes Read &dwNeeded)) // bytes In Next record { While (dwRead > 0) { // Print the event identifier, Type, And source name. // The source Name is just past the End of the // formal structure. printf("%02d Event ID: 0x%08X ", dwThisRecord++, pevlr->EventID); printf("EventType: %d Source: %s\n", pevlr->EventType, (LPSTR) ((LPBYTE) pevlr + SizeOf(EVENTLOGRECORD))); dwRead -= pevlr->Length; pevlr = (EVENTLOGRECORD *) ((LPBYTE) pevlr + pevlr->Length); } pevlr = (EVENTLOGRECORD *) &bBuffer; }
Scott
Comment