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

    programming serial port in visual c++

    Hi guys. I don't have much experience using visual c++. I need a simple program the reads and writes from a serial port connection. I've searched online and found a few examples, but I cannot get any of them to run. Could anybody tell me some real basic stuff on what I need to do here? Example code would be really nice. Thanks in advance.

  2. #2
    Join Date
    Mar 2007
    Posts
    157

    Re: programming serial port in visual c++

    hi,
    you can use create file api to send and recieve data from serial port but there are lot more things you should know about. refer a book serial port complete. in short it has a base address 3F8 and having registors which can be programed by your need.i dont know whether this site have serial port programes or not but codeproject definatly has. Please tell me what you want to do with serial port so i can help you out

    thanx
    djai

  3. #3
    Join Date
    Mar 2007
    Posts
    4

    Re: programming serial port in visual c++

    Hi djai. Thanks for the quick reply.

    Basically, I need to have a gui for the user to enter some message and sent that message through serial port to an RF transmitter. Then maybe the transmitter will send a feed back to the GUI again through serial port. It doesn't seem like a hard or large program to build, but I've spent a couple of days doing research online to get me started and am still confused. I think I'm missing something simple. >.>

  4. #4
    Join Date
    Dec 2004
    Posts
    78

    Re: programming serial port in visual c++

    Not a problem u can make both console based application as well as GUI based appliaction....You can use Sockets for that....use msdn and see a simple example from there...
    regards

  5. #5
    Join Date
    Mar 2007
    Posts
    4

    Re: programming serial port in visual c++

    Quote Originally Posted by sacz_82
    Not a problem u can make both console based application as well as GUI based appliaction....You can use Sockets for that....use msdn and see a simple example from there...
    regards
    Can you be more specific? I've looked at some examples I found online, but I can't get them to run, I guess largely due to the fact that I don't know what kind of project to use in VS2005.

  6. #6
    Join Date
    Oct 2005
    Location
    Bangalore
    Posts
    1,051

    Re: programming serial port in visual c++

    Have you looked at the article section in CG ? there are lots of articles on Serial Communication


    Serial Communication in Windows
    - Sreehari
    "Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
    " Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin

  7. #7
    Join Date
    Mar 2007
    Posts
    157

    Re: programming serial port in visual c++

    hi,
    i'll send you code in evening to transfer adn recieve data through serial port.
    i'm a embedded system programmer so please tell me how you connect serial port to RF. is there any microcontroller in between. Please tell me more specific.

    thanx

  8. #8
    Join Date
    Dec 2004
    Posts
    78

    Re: programming serial port in visual c++

    do u wanna make SDK application or what ? for sdk you select win32 application project type.and then write winmain and winproc.there u can declare sockets...u can also use threads if you want to make multi user chat program....

  9. #9
    Join Date
    Mar 2007
    Posts
    157

    Re: programming serial port in visual c++


  10. #10
    Join Date
    Mar 2007
    Posts
    157

    Re: programming serial port in visual c++

    http://www.robbayer.com/files//serial-win.pdf
    go to this link for windows serial port programming

  11. #11
    Join Date
    Jun 2014
    Posts
    1

    Re: programming serial port in visual c++

    Connecting serial port to laptop these days is difficult as the ports are not being put up in the computer hardware these days.So you will require a serial port to usb converter.

    Now with this conversion done this blog site gives an entire example on how to receive that data at visual studio 2010 windows form application : http://abhishek4273.wordpress.com/20...visual-studio/

    I hope this helps you,if you have any other queries just ask it here or mail me up at : abhishek4273@gmail.com

    Thank you

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