VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple code to write event viewer (without using API calls)

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

Rate Simple code to write event viewer (without using API calls)



    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


Download this snippet    Add to My Saved Code

Simple code to write event viewer (without using API calls) Comments

No comments have been posted about Simple code to write event viewer (without using API calls). Why not be the first to post a comment about Simple code to write event viewer (without using API calls).

Post your comment

Subject:
Message:
0/1000 characters