CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    Bangalore
    Posts
    127

    How to access serial port in VC++

    Hello All,

    The requirement is simple. I want to access serial port and do read and write operation on it.

    If anybody having sample code it is really great

    Please help me

    thanks and regards
    Raghavendra H

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

    Re: How to access serial port in VC++

    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).

  3. #3
    Join Date
    Jul 2003
    Location
    Sunshine Coast, Australia
    Posts
    132

    Re: How to access serial port in VC++

    You could use JH.CommBase. Try looking at this article http://www.codeproject.com/csharp/freakshow.asp
    Lloydy

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