Hi there,
When there is a new entry in the event log I will create a new
instance of a form which shows the information in the event log.
However, once the new form is created, my application becomes
unresponsive.
Can anyone help me with it?
Public Overridable Sub NewMessageArriv ed(ByVal [source] As Object,
ByVal e As EntryWrittenEve ntArgs)
Dim Entry As EventLogEntry
Dim Result() As String
Entry = e.Entry
Dim TimeStamp As String
Dim MachineName As String
Dim MsgHeader As String
Try
Dim Sender As String
Dim Prefix As String = "Applicatio n popup: Messenger
Service : Message from "
If IsNothing(Entry ) = True Then
Exit Sub
End If
MachineName = Entry.MachineNa me
TimeStamp = Entry.TimeWritt en
Result = Entry.Message.S plit(vbCrLf)
Sender = GetSenderID(Res ult(0))
MsgHeader = Prefix + Sender + " to " + MachineName + " on
" + TimeStamp + vbCrLf + vbCrLf
Dim str As String
str = Entry.Message.T oString
str = str.Replace(Msg Header, "")
If ChatInSession(S ender) = False Then
Dim Chat As New frmChat
Me.AddOwnedForm (Chat)
Chat.Text = "Chat window with " + Names
Chat.Tag = UIDs
Chat.Show()
End If
Catch ex As Exception
MsgBox(ex.ToStr ing)
End Try
End Sub
When there is a new entry in the event log I will create a new
instance of a form which shows the information in the event log.
However, once the new form is created, my application becomes
unresponsive.
Can anyone help me with it?
Public Overridable Sub NewMessageArriv ed(ByVal [source] As Object,
ByVal e As EntryWrittenEve ntArgs)
Dim Entry As EventLogEntry
Dim Result() As String
Entry = e.Entry
Dim TimeStamp As String
Dim MachineName As String
Dim MsgHeader As String
Try
Dim Sender As String
Dim Prefix As String = "Applicatio n popup: Messenger
Service : Message from "
If IsNothing(Entry ) = True Then
Exit Sub
End If
MachineName = Entry.MachineNa me
TimeStamp = Entry.TimeWritt en
Result = Entry.Message.S plit(vbCrLf)
Sender = GetSenderID(Res ult(0))
MsgHeader = Prefix + Sender + " to " + MachineName + " on
" + TimeStamp + vbCrLf + vbCrLf
Dim str As String
str = Entry.Message.T oString
str = str.Replace(Msg Header, "")
If ChatInSession(S ender) = False Then
Dim Chat As New frmChat
Me.AddOwnedForm (Chat)
Chat.Text = "Chat window with " + Names
Chat.Tag = UIDs
Chat.Show()
End If
Catch ex As Exception
MsgBox(ex.ToStr ing)
End Try
End Sub
Comment