by Alexandre Bianco (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 9th December 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple code to write event viewer (without using API calls)
API Declarations
Private Enum EventErrorType
iInformation = 0
iError = 1
iWarning = 2
End Enum
fSaveLogEventViewer "teste ERROR", iError
fSaveLogEventViewer "teste WARNING", iWarning
fSaveLogEventViewer "teste INFORMATION", iInformation
End Sub
Private Sub fSaveLogEventViewer (ByVal cDescription As String, ByVal iErrorType As EventErrorType)
Dim oShell As Object
Set oShell = CreateObject("WScript.Shell")
oShell.LogEvent iErrorType , cDescription
End Sub