[in] Array of characters to be written to the device.
LowLevelWriteString
Writes raw bytes directly to a device without going through the formatted I/O write buffer.
Syntax
Section titled “Syntax”virtual HRESULT LowLevelWriteString(const CString& strBuf, long* pcchActual = NULL, bool bAddTrailing = true, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT LowLevelWriteString(BSTR strBuf, long* pcchActual = NULL, bool bAddTrailing = true, long lTimeout = CUR_TIMEOUT) override;Parameters
Section titled “Parameters”strBuf
pcchActual
[out] Actual number of bytes written to the device. pcchActual may be set to NULL if the caller is not interested in knowing the actual number of bytes written.
bAddTrailing
[in] true to have the trailing characters specified by the SetTrailingForWrites function automatically added to strBuf before sending 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”Unlike the buffered I/O functions, such as Printf, Write and WriteNumber, etc., the LowLevelWriteString function sends raw bytes directly to the device, rather than going through the formatted I/O write buffer.
Each character in strBuf is converted to ASCII and sent to the device. An error is returned if one or more of the Unicode characters in strBuf cannot be converted to ASCII.
Example
Section titled “Example”The following example demonstrates use of the LowLevelWriteString function.
STDMETHODIMP Acme4321::IAcme4321_Configure(BSTR bstrData){ HRESULT hr = S_OK;
hr = io.LowLevel.LowLevelWriteString(bstrData);
return hr;}