[in] Single character to send to the device.
WriteNoPoll
Sends data to a device without polling for instrument errors after the write.
Syntax
Section titled “Syntax”virtual HRESULT WriteNoPoll(char ch, bool bFlush = true, long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT WriteNoPoll(BYTE* pBuf, long cbDesired, long* pcbActual = NULL, bool bFlush = true, long lTimeout = CUR_TIMEOUT) abstract;
virtual HRESULT WriteNoPoll(SAFEARRAY* psaBuf, long cbDesired = -1, long* pcbActual = NULL, bool bFlush = true, long lTimeout = CUR_TIMEOUT) abstract;Parameters
Section titled “Parameters”ch
pBuf
[in] Array of bytes to send to the device.
psaBuf
[in] SAFEARRAY of bytes to send to the device. if cbDesired is -1, all elements of the SAFEARRAY are sent.
cbDesired
[in] Number of elements (bytes) to send to the device. If set to -1 and the input is a SAFEARRAY, then all elements of the SAFEARRAY are sent.
pcbActual
[out] Actual number of elements (bytes) sent to the device.
bFlush
[in] If true, the formatted I/O write buffer is flushed to the device.
lTimeout
[in] I/O timeout value in milliseconds.
Return value
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”This function behaves identically to Write except that the device is not polled for errors after the data is sent.
Example
Section titled “Example”The following example demonstrates use of the WriteNoPoll function.
STDMETHODIMP Acme4321::IAcme4321_Configure(BYTE chData, SAFEARRAY* psaData){ HRESULT hr = S_OK;
// Queue up individual characters in the write buffer hr = io.WriteNoPoll('A', false); hr = io.WriteNoPoll('B', false); hr = io.WriteNoPoll(chData, false);
// Send array of bytes and flush buffer to device hr = io.Write(psaData);
return hr;}