Tony Cappellini wrote:
> I've added the While loop Mark suggested but still see the same issue.
> GetNumberOfEventLogRecords() still returns 6 events,
> However the object returned from ReadEvenLog() still only contains 3 objects
> The next call to ReadeventLog() returns None
>   

OK, in my test, repeated calls to ReadEventLog eventually fetch all of
the events.  Each call to ReadEventLog will return however many events
will fit in 1024 bytes, which is the buffer in the pywin32 code.  If I
change your code to this:

while 1:
    events=win32evtlog.ReadEventLog(hand,flags,0)
    if not events:
        break
    for event in events:
        print event.EventID, event.StringInserts

then it all works as expected.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to