Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event Log Seq Read Problem?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00406766
Message ID:
00406806
Views:
25
>>I am getting an error 'Variable EVENT_LOG_SEQUENTIAL_READ Not Found'. I am running NT4/SP6a. What happened?


>I don't see where you've defined the constants. Is there an include file.

Hmmm. I just dug around and found winnt.h in my VC98 directory. So I copied that to my app directory and now my program looks like the below. I think it is ignoring the "#include winnt.h" part for some reason. When run, the output is a lot of garbage control characters with some NT-specific text interspersed.
#include winnt.h

#define EVENTLOG_SEQUENTIAL_READ        0X0001
#define EVENTLOG_SEEK_READ              0X0002
#define EVENTLOG_FORWARDS_READ          0X0004
#define EVENTLOG_BACKWARDS_READ         0X0008
#define EVENTLOG_SUCCESS                0X0000
#define EVENTLOG_ERROR_TYPE             0x0001
#define EVENTLOG_WARNING_TYPE           0x0002
#define EVENTLOG_INFORMATION_TYPE       0x0004
#define EVENTLOG_AUDIT_SUCCESS          0x0008
#define EVENTLOG_AUDIT_FAILURE          0x0010

DECLARE INTEGER OpenEventLog IN Advapi32.dll ;
	STRING cComputerName, ;
	STRING cLogName

DECLARE INTEGER ReadEventLog IN AdvAPI32.dll ;
	INTEGER lhEventLog, ;
	INTEGER dwFlags, ;
	STRING dwOffset, ;
	STRING cBuffer, ;
	INTEGER nBytesToRead, ;
	STRING @ dwBytesRead, ;
	STRING @ dwMinBytesNeeded 

lhEventLog = OpenEventLog("SCRAFT","Security")
lnBufferSize = 1024
lcBuffer = REPLICATE(CHR(0), lnBufferSize)
lcBytesRead = SPACE(4)
lcBytesNeeded = SPACE(4)

lnNumberofrecords = ReadEventLog(lhEventLog, ;
		EVENTLOG_SEQUENTIAL_READ + EVENTLOG_FORWARDS_READ, ;
		0, ;
		@lcBuffer, ;
		lnBufferSize, ;
        @lcBytesRead, ;
		@lcBytesNeeded)

?"Buffer: ", lcBuffer
Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform