![]() | WriteNoPoll |
Sends data to a device without polling for instrument errors after the write.
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;
[in] Single character to send to the device.
[in] Array of bytes to send to the device.
[in] SAFEARRAY of bytes to send to the device. if cbDesired is -1, all elements of the SAFEARRAY are sent.
[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.
[out] Actual number of elements (bytes) sent to the device.
[in] If true, the formatted I/O write buffer is flushed to the device.
[in] I/O timeout value in milliseconds.
Returns S_OK if successful, otherwise a failure HRESULT.
This function behaves identically to Write except that the device is not polled for errors after the data is sent.
The following example demonstrates use of the WriteNoPoll function.
// CoAcme4321.cpp 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; }