Exemple de traitement d'événements
Ce qui suit est un court exemple de la façon d'implémenter les événements de session
Option Explicit Private WithEvents mSess As autECLSession 'AutSess added as reference sub main() 'Create Objects Set mSess = New autECLSession mSess.SetConnectionByName "A" mSess.RegisterCommEvent 'register for communication link notifications ' Display your form or whatever here (this should be a blocking call, otherwise sub just ends call DisplayGUI() mSess.UnregisterCommEvent set mSess = Nothing End Sub 'This sub will get called when the Communication Link Status of the registered 'connection changes Private Sub mSess_NotifyCommEvent() ' do your processing here End Sub 'This event occurs if an error happens in Communications Link event processing Private Sub mSess_NotifyCommError() 'Do any error processing here End Sub 'This event occurs when Communications Status Notification ends Private Sub mSess_NotifyCommStop() 'Do any stop processing here End Sub