Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 668
 
4-17
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1)
 
Chapter 4      Building Your Application
Using the COM CIL in Visual Basic 6.0
  •
Cisco COM CTIOS Arguments Library
Click on the OK button to exit the Project Reference screen, and save your project. 
Registering for Events in Visual Basic 6.0
To start using the CTI OS Client Interface Library in your application, you will 
need to declare the Session object and register for events.
In your code window, you will also need to declare (Dim) the Session object, and 
register for COM events from it. The following sample code demonstrates the 
syntax required to declare the Session object and register for COM events in 
Visual Basic 6.0:
Dim WithEvents session As CTIOSCLIENTLib.session
In addition, you will need to tell Visual Basic to create the Session object when 
your application loads, and to destroy to Session object when your application 
closes: 
Private Sub Form_Load()
    Set session = New session
End Sub
Private Sub Form_Terminate()
    Set session = Nothing
End Sub
Your Visual Basic 6.0 application now references the CTI OS Client Library and 
is registered to receive COM events. 
Next Steps
  •
For detailed information on the CTI OS client start up and shut down 
sequence, see the section “Disconnecting from CTI OS Server”.
  •
For detailed information on the CTI OS Client Interface Library objects, see 
Chapters 8 through 12.
  •
For a sample application written in Visual Basic 6.0, see the Vbphone sample 
application on the CTI OS CD.