Skip to content

ReadStringNoPoll

Reads string data from a device without polling for instrument errors after the read.

virtual HRESULT ReadString(CString& pResult, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT ReadString(BSTR* pResult, long lTimeout = CUR_TIMEOUT) override;

pResult

[out] String data read from the device.

lTimeout

[in] I/O timeout value in milliseconds.

Returns S_OK if successful, otherwise a failure HRESULT.

This function behaves identically to ReadString except that the device is not polled for errors after the data is read.

The following example demonstrates use of the ReadStringNoPoll function.

CoAcme4321.cpp
STDMETHODIMP Acme4321::IAcme4321_QueryData(BSTR* pbstrData)
{
HRESULT hr = S_OK;
// Read until END or termchar encountered
hr = io.ReadStringNoPoll(pbstrData);
return hr;
}