解释一个指令

来源:百度知道 编辑:UC知道 时间:2024/06/07 04:18:25
ClearCommError(hCom, &dwErrorFlags, &ComStat);
fState = ReadFile(hCom, buf, ComStat.cbInQue, &length, &ovRead);
特别是其中的comstat.cbinque用在readfile()里面的意思?

ClearCommError就是获得并清除Com通信的错误信息。
ComStat.cbInQue: Number of bytes received by the serial provider but not yet read by a ReadFile operation. (from MSDN)ReadFile这个参数就是读取的字节数。