| Test as follows: LOCAL welog As WindowsEventLog,;
werecord As WindowsEventRecord, nReccount
welog = CREATEOBJECT("WindowsEventLog",;
NULL, "Application")
WAIT WINDOW NOWAIT "Reading log records..."
nReccount = welog.ReadLogRecords()
WAIT CLEAR
CREATE CURSOR csResult ( recordnumber I,;
timegenerated T, timewritten T,;
eventid I, eventtype I, numstrings I,;
eventcategory I, stringoffset I,;
datalength I, dataoffset I, strings M,;
eventdata M, eventbuffer M,;
sysname C(32), source C(200))
FOR EACH werecord IN welog.WindowEventRecords
WITH werecord
INSERT INTO csResult VALUES (.recordnumber,;
WE_START_DATETIME+.timegenerated,;
WE_START_DATETIME+.timewritten,;
.eventid, .eventtype, .numstrings,;
.eventcategory, .stringoffset,;
.datalength, .dataoffset,;
.strings, .eventdata, .eventbuffer,;
.sysname, .source)
ENDWITH
NEXT
* * *
Read also: Using the Windows Event Log from Visual FoxPro by Craig Berntson.
|