[AccessD] ISFEMonitoring Class (talking between applications)

Drew Wutka DWUTKA at Marlow.com
Mon Jul 16 16:56:36 CDT 2007


Option Explicit
Dim WithEvents tmrMessages As Timer
Dim Messages As Collection
Dim WithEvents Messaging As ISFEMessaging
Event MonitoringEvent(strTextToDisplay As String)
Private Sub Class_Initialize()
Set Messages = New Collection
Set tmrMessages = frmMain.tmrMessages
Set Messaging = imMessaging
End Sub
Private Sub Class_Terminate()
Set Messages = Nothing
Set tmrMessages = Nothing
Set Messaging = Nothing
End Sub
Private Sub Messaging_HandshakeCompleted(intRemoteHwnd As Long)
RaiseEvent MonitoringEvent("Handshake Complete with hWnd: " &
intRemoteHwnd)
End Sub
Private Sub Messaging_ISFEMessage(im As ISFEMessage)
Messages.Add im
tmrMessages.Enabled = True
End Sub
Private Sub tmrMessages_Timer()
Dim im As ISFEMessage
Do Until Messages.Count = 0
    Set im = Messages(1)
    ProcessMessage im
    Messages.Remove (1)
Loop
tmrMessages.Enabled = False
End Sub
Private Function ProcessMessage(im As ISFEMessage)
Select Case im.MessageType
    Case "Pulse"
        RaiseEvent MonitoringEvent("Pulse: " & im.SecondParameter & " -
" & im.DataInfo("CurrentTime"))
        If im.SecondParameter > 0 Then
            im.SecondParameter = im.SecondParameter - 1
            im.AddData "CurrentTime", "Time: " & Format(Time,
"dd/mm/yyyy hh:mm:ss")
            im.SendData
            Set im = Nothing
        End If
End Select
End Function
The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI BusinessSensitve material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list