Solved

Manipulating the eventviewer with a VB Dll

Posted on 2003-11-11
4
208 Views
Last Modified: 2010-05-01
Hi experts,
             is it possible to save and delete the application events caught by the Windows eventViewer ?

I'm doing a little dll to do a daily clean of the events and some ohter stuff ... but i don't know how to mess with the eventviewer by the code .


Regards!

- David
0
Comment
Question by:David MacDonald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 9724018
VB.Net has classes that let you read the event log.
0
 
LVL 1

Author Comment

by:David MacDonald
ID: 9724373
emoreau : thanks, but I'm stuck with VB6 ... no .Net for now-(bummer!)...

I have to use the API functions, but it looks a bit complex ...

For example:

Dim test As Long
   
test = BackupEventLog(OpenEventLog("", "Application"), "C:\testLogEvent.txt")

I'm not sure what to put for the 1st parameter of OpenEventLog ... the name of the computer ... is it it's networkName ??   and the second, is it the kind of event to be backed-up (Application, security and system) ?

I cannot find any viable exemple ... not in vb anyway

Anyone can help?

Regards

- David
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 125 total points
ID: 9724416
try to pass VBNullString
0
 
LVL 1

Author Comment

by:David MacDonald
ID: 9724582
hoho ... thanks a lot emoreau

I suppose that it's simpler in vb.Net .... anyways, it works well now ...


Regards!

- David
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question