Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Receiving binary data with MSCOMM32.ocx

Receiving binary data with MSCOMM32.ocx

Scheduled Pinned Locked Moved Visual Basic
data-structureshelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aby Philip
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups