How do I transfer binary data with your controls?
An example of use would be:
Dim A(0:5) as Byte 'remember to dim explicitly "0 to len-1"
For i=0 to 5
a(i) = chr(127+i)
next i
IPPort1.DataToSendB = A
A similar problem arises when receiving data. In
that case there's ONLY ONE byte-array property
called DataIn
Private Sub IPDaemon1_DataIn(ConnectionId As Integer, Text As String,
EOL As Boolean)
'the Text parameter contains the received data which, sometimes,
'may have been converted incorrectly -- especially in Unicode
environments.
'the DataInB property has always the correct bytes.
Dim A() As Variant
'get the array's value when you first enter the event. -- VERY Important
with IPDaemon
A = IPDaemon1.DataInTextB
'only now you may manipulate it ...
Debug.Print Text
For I = LBound(A) To UBound(A)
Debug.Print A(I)
Next I
End Sub
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.