[in] String describing the format of the data to be read. See the topic I/O Format Specifiers for Read Operations for details.
Scanf
Reads formatted input from a device.
Syntax
Section titled “Syntax”virtual HRESULT Scanf(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”The Scanf function reads and formats data using the strFormat format specifier. The scanned data is stored in the argument passed to Scanf.
Example
Section titled “Example”The following example demonstrates use of the Printf function. Note that the topic I/O Format Specifiers for Write Operations has many more examples of format strings that can be used with Printf.
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.Scanf(_T("%$C[^,],%$C[^,],%$C[^,],%$C[^,]"), &strManufacturer, &strModel, &strSerial, &strRevision); }
return hr;}