Telnet und VB

Kufstein

B1G-Software-Kunde
Hallöle Zusammen.

Ich habe da ein kleines PRoblem und bin auf Hilfe angewisen.

Ich bin neuling in Visual Basic 6.0. Ich habe da ein Programm geschrieben was über Telnet auf das BPM Studio (Alcatech) Zugreift und einen Fade durchführt.

Programmiert habe ich es in Windows XP VB 6 und mit dem BPM Studio 4.7.5 getedstet. Läuft einwandfrei.

Jetzt habe ich es einem guten Freund versprochen der es auf Windows 2000 und BPM Studio 4.2 laufen lassen will.
Am Anfang kam eine Fehlermeldung das RICHTX32.OCX nicht registiert ist. Ich hab die Datei runtergeladen und registiert.


Jetzt startet zwar das Programm bei Ihm, aber birngt beim Connetion zum BPM einen Fehler "Runtime 40006 WRONG portocol or conection state for the requested or request" und bricht ab. Aber der Telnet Server läuft, und läst sich auch über Telnet ansteuern.

Hier ist der Quelltext VB:
Code:
Dim Data$, ComClick%




Private Sub Command2_Click()
    Ws.Close
    Text3.SelText = "Disconnected" & vbCrLf
End Sub



Private Sub Form_Load()
Command1.Tag = "Disc"

End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
    Ws.SendData Text4.Text & vbCrLf
    Text3.SelColor = vbRed
    Text3.SelText = Text4.Text & vbCrLf
    Text3.SelColor = vbBlack
    Text4.Text = ""
End If

End Sub

Private Sub txtOut_Change()

End Sub

Private Sub Timer1_Timer()
Timer1.Enabled = False
staxy.Caption = "Verbindung zu BPM auf Port 23 herstellen ..."
' Ws.SendData "setauto=0" & vbCrLf
On Error GoTo Error1
Text3.Text = ""
Text3.SelText = "Connecting: " & Text1.Text & ":" & Text2.Text & "..." & vbCrLf
If Command1.Tag = "Disc" Then
    Ws.RemoteHost = Text1.Text
    Ws.RemotePort = Text2.Text
    Ws.Connect
    Command1.Tag = "Con"
    'Command1.Caption = "Re-Connect"
    Exit Sub
End If
If Command1.Tag = "Con" Then
    Ws.Close
    Ws.RemoteHost = Text1.Text
    Ws.RemotePort = Text2.Text
    Ws.Connect
    Exit Sub
End If
Error1:
    
    MsgBox Err.Description, vbOKOnly, "Error: " & Err.Number
End Sub

Private Sub Timer2_Timer()
Timer2.Enabled = False

staxy.Caption = "Autofader abschalten ...."
    Ws.SendData "setauto=0" & vbCrLf
End Sub

Private Sub Timer3_Timer()
Timer3.Enabled = False

staxy.Caption = "Fadeout wird durchgeführt...."
    Ws.SendData "fadeout=2000" & vbCrLf
End Sub

Private Sub Timer4_Timer()
Timer4.Enabled = False

staxy.Caption = "Fadeout wird durchgeführt...."
    Ws.SendData "fadeout2=2000" & vbCrLf
End Sub

Private Sub Timer5_Timer()
staxy.Caption = "Sound wird abgespielt ..."
Timer5.Enabled = False

Call PlaySound("C:\BPA\wave.wav")
   
End Sub

Private Sub Timer6_Timer()
Timer6.Enabled = False

staxy.Caption = "Autofade wird aktiviert...."
    Ws.SendData "autofade=1" & vbCrLf
End Sub

Private Sub Timer7_Timer()
Timer7.Enabled = False

staxy.Caption = "BPM wird gestartet...."
    Ws.SendData "play2" & vbCrLf
End Sub

Private Sub Timer8_Timer()
Timer8.Enabled = False

staxy.Caption = "Autofade wird aktiviert ..."
    Ws.SendData "setauto=1" & vbCrLf

End Sub

Private Sub Timer9_Timer()

    Ws.Close
    Unload Me
End Sub

Private Sub Ws_Close()
    Text3.SelText = "Connection Closed" & vbCrLf
End Sub

Private Sub Ws_Connect()
    Text3.SelText = "Connected" & vbCrLf

End Sub

Private Sub Ws_ConnectionRequest(ByVal requestID As Long)
    Text3.SelText = "Connecting..."
End Sub

Private Sub Ws_DataArrival(ByVal bytesTotal As Long)
Ws.GetData Data
Text3.SelText = Data
End Sub

Private Sub Ws_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Text3.SelText = "ERR: " & Number & " - " & Description & vbCrLf
End Sub

Wäre sehr nett wenn mir jemand helfen könnte..


Das Programm im fertigen zusand: http://q-radio.eu/BPA.exe
 
Back
Top