On 19 Jan 2004 19:36:26 -0800,
ja************@yahoo.com (Jamil) wrote
in comp.lang.c++:
I have a device connected through serial port of my desk top PC
running Windows 2000. The device is sending some data as serial stream
asynchronously. I need to do the follwings:
1) Open the COM1 port of the PC
2) Read the data coming from the connected device
3) Save the data into a file
4) After writing all the data, the COM1 port should be closed
Please refer me any sample code either in C or C++ which I could run
on Windows 2000 PC side for above tasks.
Sorry, but you can't do any of those things in standard C++, the topic
here. The C++ language (and the C language, for that matter) do not
define or support direct access to any hardware at all. All input and
output is defined in terms of C++ stream or C FILE objects.
You need to ask in a support group for your particular compiler to
find out what non-standard extensions it might provide to help with
this. It is a compiler and platform specific issue, not a language
one.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html