VarTokenizeFormatString function (oleauto.h)
Parses the actual format string into a series of tokens which can be used to format variants using VarFormatFromTokens.
Syntax
HRESULT VarTokenizeFormatString(
[in, optional] LPOLESTR pstrFormat,
[in, out] LPBYTE rgbTok,
[in] int cbTok,
[in] int iFirstDay,
[in] int iFirstWeek,
[in] LCID lcid,
[in, optional] int *pcbActual
);
Parameters
[in, optional] pstrFormat
The format string. For example "mm-dd-yy".
[in, out] rgbTok
The destination token buffer.
[in] cbTok
The size of the destination token buffer.
[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] lcid
The locale to interpret format string in.
[in, optional] pcbActual
Points to the integer which is set to the first generated token. This parameter can be NULL.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
Success. |
|
One or more of the arguments is not valid. |
|
The destination token buffer is too small. |
Remarks
Parsing the format string once and then using it repeatedly is usually faster than calling VarFormat repeatedly, because the latter routine calls VarTokenizeFormatString for each call.
The locale you pass in controls how the format string is interpreted, not how the actual output of VarFormatFromTokens looks.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | oleauto.h |
Library | OleAut32.lib |
DLL | OleAut32.dll |