[in] String describing the format for arguments. See the topic I/O Format Specifiers for Write Operations for details.
PrintfNoPoll
Sends formatted output to a device without polling for errors.
Syntax
Section titled “Syntax”virtual HRESULT PrintfNoPoll(const CString strFormat [, argument] ...) abstract;Parameters
Section titled “Parameters”strFormat
argument
[in] Optional arguments interpreted by the format string.
Return value
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”This function behaves identically to Printf except that the device is not polled for errors after the data is sent. This can be useful in cases where a query string is sent to the device and a separate function will be executed to read the results. Were Printf used in such a situation instead of PrintfNoPoll, the error polling command would attempt to write to the device again — before the results of the initial query could be read.
Example
Section titled “Example”The following example demonstrates use of the PrintfNoPoll function. Note that the topic I/O Format Specifiers for Write Operations has many more examples of format strings that can be used with PrintfNoPoll.
STDMETHODIMP Acme4321::IAcme4321_Configure(long Channel, long* Count){ HRESULT hr = S_OK;
// Send query command to device, without polling for errors hr = io.PrintfNoPoll(_T("TRIG:COUNT? %d"), Channel); if (SUCCEEDED(hr)) {
// ... other logic
hr = io.ReadNumber(Count); }
return hr;}