ROOKIE
April 14th, 1999, 02:01 PM
I am attempting to write to and read from the serial port using the CreateFile function. This works fine when I am writing to the port, but when I should be seeing data coming back in, I don't get anything. I set the timeouts and the function returns, but the number of bytes read is always zero. I don't understand why this isn't working. I am able to write to the port successfully, which indicates that the baud rate and all of the transmit settings are configured properly. Is there some setting that is only for receiving data that I should look at? Is there some way to see what the error is that is causing my function to not receive data?
ReadFile(
FileIO, // handle of file to read
lpBuffer, // address of buffer that receives data
nNumberOfBytesToRead, // number of bytes to read
&lpNumberOfBytesRead, // address of number of bytes read
NULL // address of structure for data
);
ReadFile(
FileIO, // handle of file to read
lpBuffer, // address of buffer that receives data
nNumberOfBytesToRead, // number of bytes to read
&lpNumberOfBytesRead, // address of number of bytes read
NULL // address of structure for data
);