BobbyOwens
New member
- Joined
- Jun 17, 2009
- Messages
- 1
- Programming Experience
- 10+
Hi,
I'm writing an application to respond to new event log messages. I've started with a prototype applicaction, to do this, but it works on some machines, but not on others.
To test, I am manually starting/stopping the WLAN service. All machines are Vista and have .NET 3.5 SP1 installed.
I have 1 development machine and 1 test machine on which I get a message box with the formatted description. On 2 other development machine and 1 other test machine, a blank message box is displayed. On debugging, I can see that e.EventRecord.FormatDescription is set to nothing. All other properties seem to be correct.
Has anyone else experiences this, or am I missing a hotfix or update?
Below is my code
------------------------------------------------------------
Imports System.Diagnostics.Eventing.Reader
Public Class frmMain
Private WithEvents objEventLogWatcher As New EventLogWatcher("System")
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
objEventLogWatcher.Enabled = True
End Sub
Private Sub EventLogWatcher_EventRecordWritten(ByVal sender As Object, ByVal e As EventRecordWrittenEventArgs) Handles objEventLogWatcher.EventRecordWritten
MessageBox.Show(e.EventRecord.FormatDescription())
End Sub
End Class
------------------------------------------------------------
Regards
Bobby
I'm writing an application to respond to new event log messages. I've started with a prototype applicaction, to do this, but it works on some machines, but not on others.
To test, I am manually starting/stopping the WLAN service. All machines are Vista and have .NET 3.5 SP1 installed.
I have 1 development machine and 1 test machine on which I get a message box with the formatted description. On 2 other development machine and 1 other test machine, a blank message box is displayed. On debugging, I can see that e.EventRecord.FormatDescription is set to nothing. All other properties seem to be correct.
Has anyone else experiences this, or am I missing a hotfix or update?
Below is my code
------------------------------------------------------------
Imports System.Diagnostics.Eventing.Reader
Public Class frmMain
Private WithEvents objEventLogWatcher As New EventLogWatcher("System")
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
objEventLogWatcher.Enabled = True
End Sub
Private Sub EventLogWatcher_EventRecordWritten(ByVal sender As Object, ByVal e As EventRecordWrittenEventArgs) Handles objEventLogWatcher.EventRecordWritten
MessageBox.Show(e.EventRecord.FormatDescription())
End Sub
End Class
------------------------------------------------------------
Regards
Bobby