Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReadEventLog problems

Status
Not open for further replies.

DJSmith

Programmer
Aug 14, 2000
82
0
0
GB
Hi Guys,

No matter how I try to call the ReadEventLog API it always returns a value of 87 (ERROR_INVALID_PARAMETERS). So I am obviously trying to use the wrong variable types (or values). I have searched extensively across the web but can't find a solution.

Any hints or sample code would be appreciated.

DJ.
 
We may be able to help better, if you gave a bit of code (or even a hint of which langauage you are using)

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Yeah I guess that could be handy.. woops!

Using VB6

lReturnCode = ReadEventLog(lLogHwd, EVENTLOG_SEQUENTIAL_READ, lLogPos, VarPtr(Log), lNumBytesToRead, lBytesRead, lMinNumBytesNeeded)

Where all of the variables are of type long except bLog which is of type Variant. 56 is the value set into lNumBytesToRead and for the examle I am setting lLogPos to 1.

I have no problems opening the Event Log and counting the number of logs so the lLogHwd variable does hold the correct value.

Thanks,

DJ.
 
VB6 eh? In that case I'd suggest joining the VB5/VB6 forum (forum222) or even the forum specifically for using the API from VB(forum711).

As a shortcut, here's my demonstration code (from forum222) on reading the event log from VB: thread222-395506
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top