Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 546
 
4-13
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
 
Chapter 4      Building Your Application
Using the COM CIL in Visual Basic
    ' all we do is listen for events
    Set m_session = m_sessionresolver.GetSession("")
End Sub
Private Sub Form_Unload(Cancel As Integer)
    Call m_sessionresolver.RemoveSession("")
End Sub
Private Sub m_session_OnCallEstablished (ByVal pIArguments As 
CTIOSCLIENTLib.IArguments)
    GetCallVariable1 pIArguments
End Sub
Function GetCallVariable1(ByVal pIArguments As 
CTIOSCLIENTLib.IArguments)
   
    Dim m_uid As String
    m_uid = pIArguments.GetValueString("Uniqueobjectid")
Dim m_call As CTIOSCLIENTLib.Call
    Set m_call = m_session.GetObjectFromObjectID(m_uid)
   
    ' retrieve callvar1
    Dim m_callvar1 As String
    m_callvar1 = m_call.GetValueString("Callvariable1")
    
    'copy call variable1 to the clipboard
    Clipboard.SetText m_callvar1
End Function
Using the COM CIL in Visual Basic
Building a custom CTI application in Visual Basic (or adding CTI functionality 
to your existing Visual Basic application) is very simple, but requires basic 
knowledge of referencing and using COM components in Visual Basic. All of the 
CIL components for COM are distributed as COM Dynamic Link Libraries (COM 
DLL). 
In order to be accessible to COM containers, including Visual Basic, COM 
components must be registered with Windows. The components that you will 
require for programming in Visual Basic are: