VarTokenizeFormatString function

Parses the actual format string into a series of tokens which can be used to format variants using VarFormatFromTokens.

Syntax


HRESULT VarTokenizeFormatString(
  _In_opt_ LPOLESTR pstrFormat,
  _Inout_  LPBYTE   rgbTok,
  _In_     int      cbTok,
  _In_     int      iFirstDay,
  _In_     int      iFirstWeek,
  _In_     LCID     lcid,
  _In_opt_ int      *pcbActual
);

Parameters

pstrFormat [in, optional]

The format string. For example "mm-dd-yy".

rgbTok [in, out]

The destination token buffer.

cbTok [in]

The size of the destination token buffer.

iFirstDay [in]

First day of the week.

ValueMeaning
0

The system default

1

Monday

2

Tuesday

3

Wednesday

4

Thursday

5

Friday

6

Saturday

7

Sunday

 

iFirstWeek [in]

First week of the year.

ValueMeaning
0

The system default.

1

The first week contains January 1st.

2

The larger half (four days) of the first week is in the current year.

3

The first week has seven days.

 

lcid [in]

The locale to interpret format string in.

pcbActual [in, optional]

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 codeDescription
S_OK

Success.

E_INVALIDARG

One or more of the arguments is not valid.

DISP_E_BUFFERTOOSMALL

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

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

 

 

Show: