Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-11
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4      Building Your Application
Using the COM CIL in Visual Basic 6.0
The following Project References window will be displayed:
In the Project References menu, select the required COM DLLs by checking the appropriate check 
boxes. The required library names are:
  •
Cisco COM CTIOS Client Interface Library
  •
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.