Formats a variant into string form by parsing a format string.
[in] The variant containing the value to format.
[in] Points to the format string for example "mm-dd-yy".
[in] First day of the week, 0 = system default, 1 = Monday, 2 = Tuesday etc.
[in] First week of the year. The following table describes the values for iFirstWeek:
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] Flags that control the formatting process. The only flags that can be set are VAR_CALENDAR_HIJRI or VAR_FORMAT_NOSUBSTITUTE.
[out] Points to the formatted string that represents the variant.
The function returns one of the following:
One or more of the arguments is invalid.
This functions uses the user's default locale while calling VarTokenizeFormatString and VarFormatFromTokens.