Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: marcodalzottoPosted on 2007-09-18 at 05:35:27ID: 19912134
The best pins you can use are: The CTS (clear-to-send) and the DSR (data-set-ready).
/en-us/lib rary/aa363 258.aspx
/en-us/lib rary/Aa363 254.aspx
First you have to open the COM port:
HFILE hCOM;
hCOM = CreateFile(
"COM1", // pointer to name of the file
GENERIC_READ | GENERIC_WRITE, // access (read-write) mode
0, // share mode
NULL, // pointer to security attributes
OPEN_EXISTING, // how to create
NULL, // file attributes
NULL // handle to file with attributes to copy
);
Then you can determine the CTS or DTR by the funcion "GetCommModemStatus"
http://msdn2.microsoft.com
And set or clear the CTS or DTR by the function "EscapeCommFunction"
http://msdn2.microsoft.com
Hope this helps