VarFormatFromTokens function (oleauto.h)

Takes a tokenized format string and applies it to a variant to produce a formatted output string.

Syntax

HRESULT VarFormatFromTokens(
  [in]           LPVARIANT pvarIn,
  [in, optional] LPOLESTR  pstrFormat,
  [in]           LPBYTE    pbTokCur,
  [in]           ULONG     dwFlags,
  [out]          BSTR      *pbstrOut,
  [in]           LCID      lcid
);

Parameters

[in] pvarIn

The variant containing the value to format.

[in, optional] pstrFormat

The original format string.

[in] pbTokCur

The tokenized format string from VarTokenizeFormatString.

[in] dwFlags

The only flags that can be set are VAR_CALENDAR_HIJRI or VAR_FORMAT_NOSUBSTITUTE.

[out] pbstrOut

The formatted output string.

[in] lcid

The locale to use for the formatted output string.

Return value

This function can return one of these values.

Return code Description
S_OK
Success.
E_OUTOFMEMORY
Out of memory.
E_INVALIDARG
One or more of the arguments is not valid.
DISP_E_TYPEMISMATCH
The argument could not be coerced to the specified type.

Remarks

The locale lcid controls the formatted output string.

Requirements

Requirement Value
Target Platform Windows
Header oleauto.h
Library OleAut32.lib
DLL OleAut32.dll