CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005
    Posts
    27

    Serial Communication

    I am trying to communicate between serial ports. The MSCOMM activex code works, but it is not what I want to use because you need the license and so forth. I have found a few examples on the web, but do any of you know a flawless way to do serial communication (read/write).

  2. #2
    Join Date
    May 2005
    Posts
    27

    Re: Serial Communication

    I don't want to use any ActiveX code at all.

  3. #3
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: Serial Communication

    Search in CodeGuru for "serial port". There were answers suggesting this, but somehow they disappeared...
    "Programs must be written for people to read, and only incidentally for machines to execute."

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Serial Communication

    Well...assuming the Windows operating system...

    Depending on what you are trying to do take a look at the functions
    Code:
    BuildCommDCB()
    ClearCommError()
    CreateFile()
    EscapeCommFunction()
    GetCommModemStatus()
    GetCommState()
    GetCommTimeouts()
    GetOverlappedResult()
    ReadFile()
    SetCommMask()
    SetCommTimeouts()
    WaitCommEvent()
    WriteFile()
    Additionally, the MSDN provides a detailed article about serial communication in Windows. Open MSDN, choose Index and type "Serial Communications". There are several subitems, choose 'Win32'... (it's also available online).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured