---
name: "VarTokenizeFormatString"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/VarTokenizeFormatString"
---

# VarTokenizeFormatString(3w)

## NAME

**VarTokenizeFormatString** (OLEAUT32.140)

## SYNOPSIS

HRESULT VarTokenizeFormatString\
  (\
   LPOLESTR *lpszFormat*,\
   LPBYTE   *rgbTok*,\
   int      *cbTok*,\
   int      *nFirstDay*,\
   int      *nFirstWeek*,\
   LCID     *lcid*,\
   int\*     *pcbActual*\
  )

## DESCRIPTION

Convert a format string into tokenised form.

## PARAMS

*lpszFormat* **\[In\]**  Format string to tokenise.

*rgbTok* **\[Out\]**  Destination for tokenised format.

*cbTok* **\[In\]**  Size of *rgbTok* in bytes.

*nFirstDay* **\[In\]**  First day of the week (**1-7**, or **0** for current system default).

*nFirstWeek* **\[In\]**  How to treat the first week (see notes).

*lcid* **\[In\]**  Locale Id of the format string.

*pcbActual* **\[Out\]**  If non-NULL, filled with the first token generated.

## RETURNS

**Success:** **S\_OK**. *rgbTok* contains the tokenised format.

**Failure:** **E\_INVALIDARG**, if any argument is invalid. **TYPE\_E\_BUFFERTOOSMALL**, if *rgbTok* is not large enough.

## NOTES

Valid values for the *nFirstWeek* parameter are: \
\
  Value  Meaning\
\
  \-----  -------\
\
    0    Use the current system default\
\
    1    The first week is that containing Jan 1\
\
    2    Four or more days of the first week are in the current year\
\
    3    The first week is 7 days long

See **[Variant-Formats(3w)](/Variant-Formats/3w.md)**, **VarFormatFromTokens(3w)**.

## IMPLEMENTATION

Declared in **"oleauto.h"**.

Implemented in **"dlls/oleaut32/varformat.c"**.

Debug channel **"variant"**.
