IDataFunctions::ConvertMoneyString
The ConvertMoneyString method converts a string representation of a currency value to a currency VARIANT, based on the specified locale.
HRESULT ConvertMoneyString(
VARIANT vtMoney,// in
VARIANT vtLocale,// in
VARIANT vtNumber// out
);
Parameters
-
vtMoney
-
A VARIANT that contains the string representation of the number to convert. The vt member of this VARIANT must be initialized to VT_BSTR, and its pbstrVal member must contain the BSTR value to convert.
-
vtLocale
-
A VARIANT that specifies the locale on which to base the conversion. If this VARIANT is empty (VT_EMPTY) or NULL (VT_NULL), ConvertMoneyString uses the locale specified by a previous call to put_Locale.
-
pvtNumber
-
If successful, a pointer to a VARIANT that contains the converted value. ConvertMoneyString initializes this VARIANT’s vt member to VT_CY, and stores the converted value in its cy member. If unsuccessful, ConvertMoneyString sets pvarNumber to NULL.
Include
<commerce.h>
Return Values
Value |
Description |
|
S_OK |
The conversion was successful. |
DISP_E_TYPEMISMATCH |
The value in vtNum is not a BSTR value. |
DISP_E_OVERFLOW |
The value in vtNum is smaller than LONG_MIN (–2147483647–1) or is greater than LONG_MAX (2147483647). |
Related Topic
IDataFunctions::Money
© 1997-1998 Microsoft Corporation. All rights reserved.