hi, i have a problem. i want to write a small progie that reads data from a GPS Mouse. the mouse is connected to a com port and spits out the position every second. can someone tell me how to read data from a com port in c++?
hi, i have a problem. i want to write a small progie that reads data from a GPS Mouse. the mouse is connected to a com port and spits out the position every second. can someone tell me how to read data from a com port in c++?
Would tend to depend on the operating system.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
how about Win 2000 or NT, it's written under NT but is supposed to run under 2000.Originally posted by adrianxw
Would tend to depend on the operating system.
You can use the CreateFile() API function, (don't worry about the name), to get a handle to a com port. Look in the help for that function with particular regard to the "Communications resources" section.
Once you have a handle you can use any of the handle based I/O API functions to read/write/control the port. That's how I would do it.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.