📄 form1.frm
字号:
VERSION 5.00
Object = "{9E12D4F7-7B6A-409A-B2E3-3425F2E3B086}#1.0#0"; "VaxVoipOcx.ocx"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "www.VaxVoip.com"
ClientHeight = 4590
ClientLeft = 45
ClientTop = 435
ClientWidth = 4305
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4590
ScaleWidth = 4305
StartUpPosition = 2 'CenterScreen
Begin VAXVOIPOCXLib.VaxVoipOcx VaxVoip
Height = 735
Left = 2760
TabIndex = 8
Top = 1680
Width = 975
_Version = 65536
_ExtentX = 1720
_ExtentY = 1296
_StockProps = 0
End
Begin VB.Timer tmrConnectionStatus
Interval = 1000
Left = 3360
Top = 2640
End
Begin VB.CommandButton cmdStop
Caption = "Stop Talk"
Enabled = 0 'False
Height = 495
Left = 1440
TabIndex = 4
Top = 2880
Width = 1095
End
Begin VB.TextBox txtRemotePort
Height = 285
Left = 120
TabIndex = 1
Top = 2400
Width = 2415
End
Begin VB.TextBox txtRemoteHost
Height = 285
Left = 120
TabIndex = 0
Top = 1800
Width = 2415
End
Begin VB.CommandButton cmdStart
Caption = "Start Talk"
Height = 495
Left = 120
TabIndex = 3
Top = 2880
Width = 1095
End
Begin VB.Line Line1
DrawMode = 1 'Blackness
X1 = 120
X2 = 4200
Y1 = 1440
Y2 = 1440
End
Begin VB.Label Label6
Caption = "Steps:"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 12
Top = 120
Width = 2055
End
Begin VB.Label Label5
Caption = "2. Use regsvr32 utility to register the activeX"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 11
Top = 720
Width = 3855
End
Begin VB.Label Label4
Caption = " e-g: regsvr32 VaxVoipOcx.ocx"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 10
Top = 960
Width = 2895
End
Begin VB.Label Label3
Caption = "1. Register the VaxVoip ActiveX first"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 9
Top = 360
Width = 3615
End
Begin VB.Label lblStatusHeading
Caption = "Connection Status:"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 7
Top = 3600
Width = 2415
End
Begin VB.Label lblStatus
BorderStyle = 1 'Fixed Single
Height = 495
Left = 120
TabIndex = 6
Top = 3960
Width = 4095
End
Begin VB.Label Label2
Caption = "Remote Host Port:"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 5
Top = 2160
Width = 2415
End
Begin VB.Label Label1
Caption = "Remote Host IP Address:"
BeginProperty Font
Name = "Verdana"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 2
Top = 1560
Width = 2415
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'*********************************************************
'* fills out form when a workstation is selected *
'*********************************************************
Private Sub cmbPeople_Click()
End Sub
'*********************************************************
'* starts a voice conversation between two Persons *
'*********************************************************
Private Sub cmdStart_Click()
Dim bResult As Boolean
'check that remote IP and port are supplied
If txtRemoteHost.Text = "" Then MsgBox ("You must specify a remote host IP address."): Exit Sub
If txtRemotePort.Text = "" Then MsgBox ("You must specify a remote port."): Exit Sub
tmrConnectionStatus.Enabled = True
'set status flags to correct values
connected = False
connecting = True
'cmdStartBlockedVoice.Enabled = False
cmdStart.Enabled = False
txtRemoteHost.Enabled = False
txtRemotePort.Enabled = False
cmdStop.Enabled = True
'set VaxVOIP component licence key
VaxVoip.SetLicenceKey ("EVALUATE")
'start Voice conversation
bResult = VaxVoip.StartTalk(txtRemoteHost.Text, txtRemotePort.Text)
End Sub
'*********************************************************
'* stops a voice conversation currently in progress *
'*********************************************************
Private Sub cmdStop_Click()
'stop taking
tmrConnectionStatus.Enabled = False
VaxVoip.StopTalk
'set status flags
connected = False
connecting = False
cmdStop.Enabled = False
cmdStart.Enabled = True
txtRemoteHost.Enabled = True
txtRemotePort.Enabled = True
End Sub
'*********************************************************
'* first run when program starts *
'*********************************************************
Private Sub Form_Load()
'Get connection status after every one second
tmrConnectionStatus.Interval = 1000
tmrConnectionStatus.Enabled = False
txtRemoteHost.Text = ""
txtRemotePort.Text = "52230"
'set status flags
connected = False
connecting = False
End Sub
'*********************************************************
'* displays the current status of the Connection *
'*********************************************************
Private Sub tmrconnectionstatus_Timer()
Dim lStatus As Long
'get the current connection status
lStatus = VaxVoip.GetConnectionStatus
'depending on status code display status message
'and also set the status flags appropriately
Select Case lStatus
Case 100
lblStatus.Caption = "NORMAL"
connected = False
Case 101
lblStatus.Caption = "ESTABLISHING_CONNECTION"
connected = False
connecting = True
Case 102
lblStatus.Caption = "CONNECTION_ESTABLISHED"
connected = True
connecting = False
Case 103
lblStatus.Caption = "COULD_NOT_ESTABLISH"
connecting = False
connected = False
Case 104
lblStatus.Caption = "VOICE_CONVERSATION_CLOSED"
connected = False
connecting = False
Case 105
lblStatus.Caption = "CANNOT_OPEN_SOUND_OUTPUT_DEVICE"
connected = False
connecting = False
Case 106
lblStatus.Caption = "CANNOT_OPEN_SOUND_INPUT_DEVICE"
connected = False
connecting = False
Case 107
lblStatus.Caption = "INPUT_DEVICE_PROBLEM"
connected = False
connecting = False
Case 108
lblStatus.Caption = "OUTPUT_DEVICE_PROBLEM"
connected = False
connecting = False
Case 109
lblStatus.Caption = "CONNECTION_LOST"
connected = False
connecting = False
End Select
'if we're not connected or connecting, enable all control except stop
If connected = False And connecting = False Then
cmdStop.Enabled = False
cmdStart.Enabled = True
txtRemoteHost.Enabled = True
txtRemotePort.Enabled = True
tmrConnectionStatus.Enabled = False
End If
'if we're connected disable all controls except stop
If connected = True And connecting = False Then
cmdStop.Enabled = True
cmdStart.Enabled = False
txtRemoteHost.Enabled = False
txtRemotePort.Enabled = False
End If
'if we're in the process of connecting, disable all controls
If connecting = True And connected = False Then
cmdStop.Enabled = True
cmdStart.Enabled = False
txtRemoteHost.Enabled = False
txtRemotePort.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -