⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 this is very good example for VB6 how to cominicate using vb
💻 FRM
字号:
VERSION 5.00
Object = "{D01BD6BE-456A-4078-AEBF-3ACB85261FA6}#3.0#0"; "VCProX.ocx"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Conference Client :: (C) Lake of Soft"
   ClientHeight    =   4080
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5790
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4080
   ScaleWidth      =   5790
   StartUpPosition =   3  'Windows Default
   Begin VCProX.vcproWaveInDeviceX waveIn 
      Height          =   495
      Left            =   4440
      TabIndex        =   2
      Top             =   240
      Width           =   1095
      Active          =   0   'False
      AutoActivate    =   -1  'True
      CalcVolume      =   0   'False
      DumpInput       =   ""
      IsFormatProvider=   -1  'True
      MinActiveTime   =   0
      MinVolumeLevel  =   0
      OverNum         =   5
      PcmBitsPerSample=   16
      PcmNumChannels  =   2
      PcmSamplesPerSec=   44100
      DumpOutput      =   ""
      DeviceId        =   -1
      DeviceDirect    =   0   'False
      DeviceMapped    =   0   'False
      SyncEvents      =   0   'False
      SilenceDetectionMode=   0
      EnableDataProcessing=   -1  'True
   End
   Begin VCProX.vcproMediaGateX Gate 
      Height          =   495
      Left            =   4440
      TabIndex        =   0
      Top             =   840
      Width           =   1065
      Active          =   0   'False
      DeviceId        =   -1
      FormatTag       =   49
      Port            =   "17820"
      Proto           =   0
      PcmBitsPerSample=   16
      PcmNumChannels  =   1
      PcmSamplesPerSec=   44100
      MaxClients      =   1
      EnableRecording =   -1  'True
      EnablePlayback  =   -1  'True
      SyncEvents      =   0   'False
      MinActiveTime   =   0
      MinVolumeLevel  =   0
      BindTo          =   ""
      ConversationSaveToFile=   0   'False
      ConversationFileName=   ""
      OverNum         =   25
      SilenceDetectionMode=   0
      StreamingMode   =   0
      RoomName        =   ""
      RoomPassword    =   ""
   End
   Begin VB.Frame Frame2 
      Caption         =   "Network"
      Height          =   1215
      Left            =   240
      TabIndex        =   11
      Top             =   1920
      Width           =   4095
      Begin VB.TextBox Text1 
         Height          =   315
         Left            =   1320
         TabIndex        =   14
         Text            =   "192.168.1.1"
         Top             =   600
         Width           =   1335
      End
      Begin VB.ComboBox Combo3 
         Height          =   315
         ItemData        =   "Form1.frx":0000
         Left            =   120
         List            =   "Form1.frx":000A
         Style           =   2  'Dropdown List
         TabIndex        =   13
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox Text4 
         Height          =   315
         Left            =   2760
         TabIndex        =   12
         Text            =   "17820"
         Top             =   600
         Width           =   1095
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "Protocol"
         Height          =   195
         Left            =   120
         TabIndex        =   17
         Top             =   360
         Width           =   585
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "Port"
         Height          =   195
         Left            =   2760
         TabIndex        =   16
         Top             =   360
         Width           =   285
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "Server IP-address"
         Height          =   195
         Left            =   1320
         TabIndex        =   15
         Top             =   360
         Width           =   1260
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Audio"
      Height          =   1695
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   4095
      Begin VB.CommandButton btnPlaySetup 
         Caption         =   "Playback..."
         Height          =   375
         Left            =   1440
         TabIndex        =   10
         Top             =   1080
         Width           =   1215
      End
      Begin VB.CommandButton btnRecSetup 
         Caption         =   "Recording..."
         Height          =   375
         Left            =   120
         TabIndex        =   9
         Top             =   1080
         Width           =   1215
      End
      Begin VB.ComboBox Combo2 
         Height          =   315
         ItemData        =   "Form1.frx":0018
         Left            =   2760
         List            =   "Form1.frx":0028
         Style           =   2  'Dropdown List
         TabIndex        =   7
         Top             =   600
         Width           =   1215
      End
      Begin VB.ComboBox Combo1 
         Height          =   315
         Left            =   120
         Style           =   2  'Dropdown List
         TabIndex        =   5
         Top             =   600
         Width           =   2535
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Sampling rate"
         Height          =   195
         Left            =   2760
         TabIndex        =   8
         Top             =   360
         Width           =   960
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "Device"
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.Timer Timer1 
      Interval        =   500
      Left            =   4800
      Top             =   2040
   End
   Begin VB.CommandButton btnDisconnect 
      Caption         =   "Disconnect"
      Height          =   375
      Left            =   1680
      TabIndex        =   3
      Top             =   3360
      Width           =   1215
   End
   Begin VB.CommandButton btnConnect 
      Caption         =   "Connect"
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Top             =   3360
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
    For i = 0 To waveIn.GetDeviceCount - 1
        Combo1.AddItem (waveIn.GetDeviceName(i))
    Next
    
    Combo1.ListIndex = 0
    Combo2.ListIndex = 0
    Combo3.ListIndex = 1
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Timer1.Enabled = False
    Gate.Active = False
End Sub

Private Sub btnConnect_Click()
    Gate.DeviceId = Combo1.ListIndex
    If Combo3.ListIndex = 0 Then Gate.Proto = unapt_TCP Else Gate.Proto = unapt_UDP
    Gate.Port = Val(Text4.Text)
    Gate.RoomName = "name"
    Gate.RoomPassword = "password"
    
    Gate.FormatTag = 49 'GSM codec
    Gate.PcmNumChannels = 1 'mono
    Gate.PcmSamplesPerSec = Val(Combo2.Text)

    Gate.Connect Text1.Text
End Sub

Private Sub btnDisconnect_Click()
    Gate.Disconnect
End Sub

Private Sub btnPlaySetup_Click()
    Shell "sndvol32 /p /d" + Str(Combo1.ListIndex), vbNormalFocus
End Sub

Private Sub btnRecSetup_Click()
    Shell "sndvol32 /r /d" + Str(Combo1.ListIndex), vbNormalFocus
End Sub

Private Sub Timer1_Timer()
    btnConnect.Enabled = Not Gate.IsClientActive
    btnDisconnect.Enabled = Gate.IsClientActive
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -