- Pour instancier la dll et pour ainsi créer un appel téléphonique
- suivez les intrusctions suivantes :
- Dans la forme que vous utiliserez ajouter les objets suivants :
- - une combobox : Nom = Cmb_Port
- - une textbox : Nom = Txt_NumTel
- - une checkbox : Nom = Chk_Standard
- - Trois boutons : Nom = btn_Raccroche - btn_Quitter - btn_Appel
-
- 'déclaration des variables globales
-
- Public WithEvents oTapiLine As CvbTAPILine
- dim strNumPhone as string
-
- Private Sub Form_Load()
- Dim bsucceed As Boolean
- Dim lLine As Long
- 'Initialise la classe TAPI
- Set oTapiLine = New CvbTAPILine
- 'Affectation de la version la plus basse et de la plus haute du TAPI
- oTapiLine.LowAPI = &H10003 ' 1.3 = &H00010003
- oTapiLine.HiAPI = &H30000 ' 3.0 = &H00030000
- 'initialise et evalue les version de tous les ports
- bsucceed = oTapiLine.Create
- 'Charger la combo des ports
-
- Cmb_Port.Clear
- Cmb_Port.AddItem "", 0
- If bsucceed Then
- For lLine = 0 To oTapiLine.numLines - 1
- oTapiLine.CurrentLineID = lLine
- 'Vérification de la version de la ligne
- If oTapiLine.NegotiatedAPIVersion Then
- Cmb_Port.AddItem oTapiLine.LineName, lLine + 1
- End If
- Next
- 'Selectionne la première occurence de la combo
- Cmb_Port.ListIndex = 0
- End If
- End Sub
-
- Private Sub Form_Unload(Cancel As Integer)
- Set oTapiLine = Nothing
- Unload Me
- End Sub
-
- Private Sub btn_Appel_Click()
- Dim bStandard As Boolean
-
- If Chk_Standard.Value = 1 Then
- bStandard = True
- Else
- bStandard = False
- End If
- strNumPhone = Trim(Replace(Txt_NumTel.Text, " ", ""))
- sbConfigTAPI
- oTapiLine.oPbStandard = bStandard
- oTapiLine.oPiPortNumber = Trim(Cmb_Port.ListIndex)
- oTapiLine.oPsPhoneNumber = strNumPhone
- oTapiLine.OpenLine
-
- oTapiLine.RbCallNumber
- End Sub
-
- Private Sub btn_Raccroche_Click()
- On Error Resume Next
-
- oTapiLine.DropCallAsynch
- Set oTapiLine = Nothing
-
- End Sub
-
- Private Sub Quitter_Click()
- On Error Resume Next
- Set oTapiLine = Nothing
- Unload Me
- End
- End Sub
-
- Private Sub sbConfigTAPI()
- Dim bsucceed As Boolean
-
- 'Initialise la classe TAPI
- Set oTapiLine = New CvbTAPILine
- 'Affectation de la version la plus basse et de la plus haute du TAPI
- oTapiLine.LowAPI = &H10003 ' 1.3 = &H00010003
- oTapiLine.HiAPI = &H30000 ' 3.0 = &H00030000
- 'initialise et evalue les version de tous les ports
- bsucceed = oTapiLine.Create
- End Sub
-
Pour instancier la dll et pour ainsi créer un appel téléphonique
suivez les intrusctions suivantes :
Dans la forme que vous utiliserez ajouter les objets suivants :
- une combobox : Nom = Cmb_Port
- une textbox : Nom = Txt_NumTel
- une checkbox : Nom = Chk_Standard
- Trois boutons : Nom = btn_Raccroche - btn_Quitter - btn_Appel
'déclaration des variables globales
Public WithEvents oTapiLine As CvbTAPILine
dim strNumPhone as string
Private Sub Form_Load()
Dim bsucceed As Boolean
Dim lLine As Long
'Initialise la classe TAPI
Set oTapiLine = New CvbTAPILine
'Affectation de la version la plus basse et de la plus haute du TAPI
oTapiLine.LowAPI = &H10003 ' 1.3 = &H00010003
oTapiLine.HiAPI = &H30000 ' 3.0 = &H00030000
'initialise et evalue les version de tous les ports
bsucceed = oTapiLine.Create
'Charger la combo des ports
Cmb_Port.Clear
Cmb_Port.AddItem "", 0
If bsucceed Then
For lLine = 0 To oTapiLine.numLines - 1
oTapiLine.CurrentLineID = lLine
'Vérification de la version de la ligne
If oTapiLine.NegotiatedAPIVersion Then
Cmb_Port.AddItem oTapiLine.LineName, lLine + 1
End If
Next
'Selectionne la première occurence de la combo
Cmb_Port.ListIndex = 0
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set oTapiLine = Nothing
Unload Me
End Sub
Private Sub btn_Appel_Click()
Dim bStandard As Boolean
If Chk_Standard.Value = 1 Then
bStandard = True
Else
bStandard = False
End If
strNumPhone = Trim(Replace(Txt_NumTel.Text, " ", ""))
sbConfigTAPI
oTapiLine.oPbStandard = bStandard
oTapiLine.oPiPortNumber = Trim(Cmb_Port.ListIndex)
oTapiLine.oPsPhoneNumber = strNumPhone
oTapiLine.OpenLine
oTapiLine.RbCallNumber
End Sub
Private Sub btn_Raccroche_Click()
On Error Resume Next
oTapiLine.DropCallAsynch
Set oTapiLine = Nothing
End Sub
Private Sub Quitter_Click()
On Error Resume Next
Set oTapiLine = Nothing
Unload Me
End
End Sub
Private Sub sbConfigTAPI()
Dim bsucceed As Boolean
'Initialise la classe TAPI
Set oTapiLine = New CvbTAPILine
'Affectation de la version la plus basse et de la plus haute du TAPI
oTapiLine.LowAPI = &H10003 ' 1.3 = &H00010003
oTapiLine.HiAPI = &H30000 ' 3.0 = &H00030000
'initialise et evalue les version de tous les ports
bsucceed = oTapiLine.Create
End Sub