I can't seem to get the SetCommTimeouts function to work. If I
understand correctly, I should be able to set the timeout so that the
functions ReadFile and WriteFile will return after the specified amount
of time? My function is doing the following:
extern "C" bool WINAPI CommPortTimeouts(HANDLE cComPort, unsigned int
readTime, unsigned int writeTime)
{
COMMTIMEOUTS ct;
ct.ReadTotalTimeoutConstant = readTime;
ct.WriteTotalTimeoutConstant = writeTime;
return (bool)SetCommTimeouts(cComPort, &ct);
}
The function invariably returns true, but ReadFile still hangs. Not sure
what I could be doing wrong...
Thanks for any responses,
Anthony
There are five fields in COMMTIMEOUTS. You only fill in two of them thus the
rest have random values.
Look up COMMTIMEOUTS in the MSDN library.
Leo Havmøller.
"Leo Havmøller" <leh@-nospam-rtx.dk> wrote in message
news:#JUY$XazCHA.1628@TK2MSFTNGP10...
Filling all the fields can help you, but beware that not all timeout
values can be set to whatever value.
For LPTx there are some restrictions, but they are described nowhere, so use
DDK sources and help.
Tõnu.
"Anthony Gallagher" <anth...@cs.cmu.edu.nospam> wrote in message
news:3E41E290...@cs.cmu.edu.nospam...