NAME

VarNumFromParseNum  (OLEAUT32.47)

SYNOPSIS

 HRESULT VarNumFromParseNum
 (
  NUMPARSE* pNumprs,
  BYTE*     rgbDig,
  ULONG     dwVtBits,
  VARIANT*  pVarDst
 )

DESCRIPTION

Convert a NUMPARSE structure into a numeric Variant type.

PARAMS

pNumprs [In] Source for parsed number. cDig must be set to the size of rgbDig.
rgbDig [In] Source for the numbers digits.
dwVtBits [In] VTBIT_ flags from "oleauto.h" indicating the acceptable dest types.
pVarDst [Out] Destination for the converted Variant value.

RETURNS

Success: S_OK. pVarDst contains the converted value.

Failure: E_INVALIDARG, if any parameter is invalid. DISP_E_OVERFLOW, if the number is too big for the types set in dwVtBits.

NOTES

- The smallest favoured type present in dwVtBits that can represent the number in pNumprs without losing precision is used.

- Signed types are preferred over unsigned types of the same size.

- Preferred types in order are: integer, float, double, currency then decimal.

- Rounding (dropping of decimal points) occurs without error. See VarI8FromR8 for details of the rounding method.

- pVarDst is not cleared before the result is stored in it.

- WinXP and Win2003 support VTBIT_I8, VTBIT_UI8 but that's buggy (by design?): If some other VTBIT's for integers are specified together with VTBIT_I8 and the number will fit only in a VT_I8 Windows® will "cast" the number to the smallest requested integer truncating this way the number. Wine doesn't implement this "feature" (yet?).

IMPLEMENTATION

Declared in "oleauto.h". https://source.winehq.org/source/include/oleauto.h

Implemented in "dlls/oleaut32/variant.c". https://source.winehq.org/source/dlls/oleaut32/variant.c

Debug channel "variant".


Copyright © 2024 The Wine Project. All trademarks are the property of their respective owners. Visit WineHQ for license details. Generated Apr 2024.