[in] String describing the format for arguments. See the topic I/O Format Specifiers for Write Operations for details.
VQueryf
Performs a formatted write and read through a single operation invocation.
Syntax
Section titled “Syntax”virtual HRESULT VQueryf(const CString strWriteFormat, const CString strReadFormat, va_list& argList, long lTimeout = CUR_TIMEOUT) abstract;Parameters
Section titled “Parameters”strFormat
argList
[in] Argument list interpreted by the format string.
lTimeout
[in] I/O timeout in milliseconds.
Return value
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”This function behaves identically to Queryf except that the arguments are supplied using a va_list argument list instead of separate argument parameters. This type of argument list function is typically used to implement higher-level functions that accept variable argument lists. Indeed, the implementation of Queryf in NtlIo.inl is done in terms of VQueryf, as shown in the example later.
The lTimeout parameter allows the I/O timeout to be temporarily changed to the specified value for the duration of the VQueryf function call. The timeout is returned to its previous value after VQueryf returns. If lTimeout is not specified, then the I/O timeout is not modified.
Example
Section titled “Example”The following example demonstrates use of the VScanf function.
inline HRESULT CIoSession::Queryf(const CString strWriteFormat, const CString strReadFormat, ...){ HRESULT hr = S_OK;
va_list argList; va_start(argList, strReadFormat);
hr = VQueryf(strWriteFormat, strReadFormat, argList);
va_end(argList);
if (SUCCEEDED(hr)) { hr = PollInstrumentErrors(); }
return hr;}