Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ReadEventLog problems

ReadEventLog problems

ReadEventLog problems

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.


RE: ReadEventLog problems

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

If at first you don't succeed, skydiving is not for you.

RE: ReadEventLog problems

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.



RE: ReadEventLog problems

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close