VarFormat function (oleauto.h)
Formats a variant into string form by parsing a format string.
Syntax
HRESULT VarFormat(
[in] LPVARIANT pvarIn,
[in, optional] LPOLESTR pstrFormat,
[in] int iFirstDay,
[in] int iFirstWeek,
[in] ULONG dwFlags,
[out] BSTR *pbstrOut
);
Parameters
[in] pvarIn
The variant.
[in, optional] pstrFormat
The format string. For example "mm-dd-yy".
[in] iFirstDay
First day of the week.
Value | Meaning |
---|---|
|
The system default |
|
Monday |
|
Tuesday |
|
Wednesday |
|
Thursday |
|
Friday |
|
Saturday |
|
Sunday |
[in] iFirstWeek
First week of the year.
Value | Meaning |
---|---|
|
The system default. |
|
The first week contains January 1st. |
|
The larger half (four days) of the first week is in the current year. |
|
The first week has seven days. |
[in] dwFlags
Flags that control the formatting process. The only flags that can be set are VAR_CALENDAR_HIJRI or VAR_FORMAT_NOSUBSTITUTE.
[out] pbstrOut
The formatted string that represents the variant.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
Success. |
|
One or more of the arguments is not valid. |
Remarks
This function uses the user's default locale while calling VarTokenizeFormatString and VarFormatFromTokens.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | oleauto.h |
Library | OleAut32.lib |
DLL | OleAut32.dll |