Event Processing Example
The following is a short example of how to implement OIA Events
Option Explicit
Private WithEvents myOIA As autECLOIA 'AutOIA added as reference
sub main()
'Create Objects
Set myOIA = New AutOIA
Set myConnMgr = New AutConnMgr
myOIA.SetConnectionByName ("B") 'Monitor Session B for OIA Updates
myOIA.RegisterOIAEvent 'register for OIA Notifications
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
'Clean up
myOIA.UnregisterOIAEvent
Private Sub myOIA_NotifyOIAEvent()
' do your processing here
End Sub
Private Sub myOIA_NotifyOIAError()
' do your processing here
End Sub
'This event occurs when Communications Status Notification ends
Private Sub myOIA_NotifyOIAStop(Reason As Long)
'Do any stop processing here
End Sub
Option Explicit
Private WithEvents mOIA As autECLOIA 'AutOIA added as reference
sub main()
'Create Objects
Set mOIA = New autECLOIA
mOIA.SetConnectionByName "A" 'Monitor Session A for OIA Updates
mOIA.RegisterCommEvent 'register for communications link Notifications
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
'Clean up
mOIA.UnregisterCommEvent
set mOIA = Nothing
End Sub
'This sub will get called when the Communication Link Status of the registered
'connection changes
Private Sub mOIA_NotifyCommEvent()
' do your processing here
End Sub
'This event occurs when Communications Status Notification ends
Private Sub mOIA_NotifyCommStop()
'Do any stop processing here
End Sub