Receiving binary data with MSCOMM32.ocx
-
I am trying to use MSCOMM32.ocx to receive binary data. MSDN provides two sample code for text data. (Q194922- INFO:Receiving Data using teh MSComm Control's OnComm Event) (for Send / Receive each). I used them as the basis and then did the following changes - - changed input mode to binary in both - To send binary data passed a Variant containing an array of bytes - On the receive side inspects the "Input" property. //////////////////////////////////////////////////// Dim data As String For i = 0 To MSComm1.InputLen - 1 data = data + "0x" + CByte(MSComm1.Input(i)) + " " Next i //////////////////////////////////////////////////// However on the receive side i am facing the following problems - - I am not sure how to get the number of bytes received. InputLen and InBufferCount gives 0 - Input is empty. - InBuff gives some 3 junk characters when i had passed (10,11,12,13,14) as bytes. Can some body help out on how to properly receive binary data? Any help is very much appreciated. thank you aby