0

ReadFile() を使用して false を返すのを待つのではなく、IsBufferEmpty() の行に沿って同期ハンドルで使用する関数があるかどうか疑問に思っていました。ReadFile() がデータを読み取ろうとする際にかかる遅延をなくすには、何かが必要です。

4

1 に答える 1

1

これはシリアルポート通信用ですか?

その場合は、次のClearCommError()関数を使用できます。

DWORD com_errors = 0;
COMSTAT com_stat;

ClearCommError(serial_port_handle, &com_errors, &com_stat);
/* com_stat.cbInQue now holds the number of characters in the receive buffer */
于 2009-06-02T14:48:51.417 に答える