[in] String describing the format of the data to be read. See the topic I/O Format Specifiers for Read Operations for details.
ScanfNoPoll
Reads formatted input from a device without polling for errors.
Syntax
Section titled “Syntax”virtual HRESULT ScanfNoPoll(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 Scanf except that the device is not polled for errors after the data is read.
Example
Section titled “Example”The following example demonstrates use of the ScanfNoPoll function. Note that the topic I/O Format Specifiers for Read Operations has many more examples of format strings that can be used with ScanfNoPoll.
STDMETHODIMP Acme4321::IAcme4321_Configure(){ HRESULT hr = S_OK;
// Send ID query to device hr = io.PrintfNoPoll(_T("*IDN?")); if (SUCCEEDED(hr)) { CString strManufacturer, strModel, strSerial, strRevision;
hr = io.ScanfNoPoll(_T("%$C[^,],%$C[^,],%$C[^,],%$C[^,]"), &strManufacturer, &strModel, &strSerial, &strRevision);
// ... }
return hr;}