Article ID: 318784 - Last Review: May 13, 2003 - Revision: 2.0 PRB: MSComm.Input Returns comReadError (8020) with Some Serial PortsThis article was previously published under Q318784 SYMPTOMS
When you use the Input method of the MSComm control with some serial ports, the MSComm.Input method may fail, and you may receive the comReadError error (error 8020).
CAUSE
This problem occurs because MSComm.Input reads only the bytes that are immediately available in the serial driver. By design, MSComm.Input does not return any bytes if the serial driver has not received any bytes. Because the MSComm control does not expect the ReadFile method to return ERROR_IO_PENDING, MSComm returns the comReadError error if this occurs.
RESOLUTION
A serial driver should return SUCCESS synchronously for all read requests that can be immediately fulfilled with data that is currently present. This problem is only known to occur with some third-party serial drivers. To correct the problem, contact the manufacturer of the serial driver to obtain an updated driver. | Article Translations
|
Back to the top
