IDataFunctions_4_0::ConvertStringToCurrency

Ee797950.c++_off(en-US,CS.10).gifEe797950.vb_on(en-US,CS.10).gif

Use this method to convert a string representation of a monetary value into a currency Variant, based on the specified locale and currency symbol.

Definition

HRESULT IDataFunctions_4_0::ConvertStringToCurrency(VARIANTvtMoneyString,VARIANTvtLocale,VARIANTvtCurrencySymbol,VARIANT*pvtRet);

Parameters

vtMoneyString

[in] A VARIANT that contains the currency string to convert.

vtLocale

[in, optional] A VARIANT that contains the locale to be used when converting the string to a currency VARIANT. If this parameter is not specified, the value of the Locale property of the DataFunctions object is used.

vtCurrencySymbol

[in, optional] A VARIANT that contains the currency symbol to expect when converting the currency string.

pvtRet

[out, retval] A pointer to a VARIANT used to return the string representation of the converted monetary value. This will be set to NULL if the monetary value string is not valid.

Return Values

The parameter pvtRet returns the parsed value or NULL if the input monetary value is not parsable. The method returns a failed HRESULT upon critical error, such as receiving an invalid argument.

Error Values

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

Remarks

The pvtRet parameter contains valid data only if the method completes successfully.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

See Also

DataFunctions Object

IDataFunctions_4_0::get_Locale, put_Locale

IDataFunctions_4_0::LocalizeCurrency

IDataFunctions_4_0::ConvertMoneyStringToNumber


All rights reserved.