Click or drag to resize

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;
Parameters
ch

[in] Single character to send to the device.

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

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

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

Example

The following example demonstrates use of the WriteNoPoll function.

C++
// 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;
}
See Also

Download a complete CHM version of this documentation here.