hallo,
ich habe leider wieder ein problem =(
diesmal eher auf seiten des eingabeterminals... und zwar habe ich das beispielprogramm welches die winsock1.senddata verwendet abgeändert.
ich habe die eingabe nicht wie im beispiel gemacht
" winsock1.senddata (text1.text) " sondern mit einer variablen versehen " winsock1.senddata (a) " die varbiable wird in abhängigkeit der combobox verändert.
die variable wurde als BYTE deklariert.... nun sagt mir der melfa, dass ein ilegales daten format vorliegt... warum?
auch funktioniert das direkte senden z.b. "winsock1.senddata ("2")
aber nicht wie ich es gemacht habe :
ZitatAlles anzeigenOption Explicit
Dim RecvData() As Byte
Dim a As Byte
Dim b As Byte
Dim c As Byte
Dim d As Byte
Dim e As Byte
Dim f As Byte
Private Sub Check1_Click()
If Check1.Value Then
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = Text2.Text
Winsock1.Connect
Else
Winsock1.Close
End If
End Sub
Private Sub Command8_Click()
Select Case Combo1.ListIndex
Case 0
a = 2
b = 3
c = 4
d = 6
e = 7
f = 8
Case 1
a = 20
b = 30
c = 40
d = 60
e = 70
f = 80
Case 2
a = 21
b = 31
c = 41
d = 61
e = 71
f = 81
Case 3
a = 22
b = 32
c = 42
d = 62
e = 72
f = 82
End Select
Text3.Text = c
End Sub
Private Sub Command1_Click()
Winsock1.SendData a
End Sub
Private Sub Command2_Click()
Winsock1.SendData b
End Sub
Private Sub Command3_Click()
Winsock1.SendData c
End Sub
Private Sub Command5_Click()
Winsock1.SendData d
End Sub
Private Sub Command6_Click()
Winsock1.SendData e
End Sub
Private Sub Command7_Click()
Winsock1.SendData f
End Sub
Private Sub Command4_Click()
Winsock1.SendData (Text1.Text)
End Sub
Private Sub Winsock1_Connect()
Command1.Enabled = True
End Sub
Private Sub Winsock1_Close()
Check1.Value = False
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
If bytesTotal > 0 Then
ReDim RecvData(bytesTotal - 1)
Call Winsock1.GetData(RecvData, , bytesTotal)
Text4.SelStart = Len(Text4.Text + vbNewLine)
Text4.SelText = StrConv(RecvData, vbUnicode)
End If
End Sub
Private Sub Winsock1_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)
Check1.Value = False
Command1.Enabled = False
Winsock1.Close
MsgBox "Error:" & Number & "(" & Description & ")"
End Sub
Private Sub Form_Load()
Combo1.AddItem "horizontal"
Combo1.AddItem "vertikal"
Combo1.AddItem "diagonal1"
Combo1.AddItem "diagonal2"
End Sub
wäre suuuuper wenn mir da jemmand weiterhelfen könnte =)
grüße
kamil