IVBFormat::Format method (vbinterf.h)

Formats a string according to a pattern.

Note  The use of this method is no longer recommended because containers other than Visual Basic do not support it.
 

Syntax

HRESULT Format(
  [in]  VARIANT *vData,
  [in]  BSTR    bstrFormat,
  [in]  LPVOID  lpBuffer,
  [in]  USHORT  cb,
  [in]  LONG    lcid,
  [in]  SHORT   sFirstDayOfWeek,
  [in]  USHORT  sFirstWeekOfYear,
  [out] USHORT  *rcb
);

Parameters

[in] vData

Data to be formatted.

[in] bstrFormat

Format string to be applied to the data.

[in] lpBuffer

Pointer to result buffer.

[in] cb

Length of result buffer.

[in] lcid

Locale ID.

[in] sFirstDayOfWeek

Affects the 'w', FirstDayOfWeek, format result.

Value Meaning
vbUseSystem
Use the FirstWeekday setting in the host UI. If no host value is provided, use the current system value from the NLS API.
vbSunday
Sunday
vbMonday
Monday
vbTuesday
Tuesday
vbWednesday
Wednesday
vbThursday
Thursday
vbFriday
Friday
vbSaturday
Saturday

[in] sFirstWeekOfYear

Affects the 'ww', FirstWeekOfYear, format result.

Value Meaning
vbUseSystem
Use the FirstWeekOfYear setting in the host UI. If no host value is provided, use the current system value from the NLS API.
vbFirstJan1
Start on January 1 (default).
vbFirstFourDays
Start with the first four-day week.
vbFirstFullWeek
Start with the first full week.

[out] rcb

Number of bytes copied to the result buffer.

Return value

This method supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

Remarks

When migrating a VBX control to an OLE control, Format replaces the Visual Basic VBFormat, which is no longer supported.

Requirements

Requirement Value
Target Platform Windows
Header vbinterf.h

See also

IVBFormat