Click or drag to resize

FlushRead

Flushes the contents of the I/O read buffer.

virtual HRESULT FlushRead(long lTimeout = CUR_TIMEOUT) sealed override;
Parameters
lTimeout

[in] I/O timeout value in milliseconds.

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

Any existing data in the I/O read buffer is discarded. In addition, if the read buffer is non-empty and no EOI was read during the last read operation, then data is read from the device until an EOI is encountered.

Example

The following example demonstrates use of the FlushRead function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::Configure()
{
  HRESULT hr = S_OK;

  // Discard contents of the I/O read buffer and read from the device until EOI
  hr = io.FlushRead();

  return hr;
}
See Also

Download a complete CHM version of this documentation here.