Solved

Manipulating the eventviewer with a VB Dll

Posted on 2003-11-11
4
205 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
  • 2
  • 2
4 Comments
 
LVL 69

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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Restricting text box entry from \/:?<>"| 9 76
SSRS expression Issue finding a string 10 66
using web browser with BING 40 110
Spell Check in VB6 13 96
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now