IAppFrameWork::RequestMoneyAsNumber

Ee824899.c++_off(en-US,CS.10).gifEe824899.vb_on(en-US,CS.10).gif

Use this method to retrieve a value from a URL query string or form post variable and convert it as money, based on the specified locale.

Definition

HRESULT IAppFrameWork::RequestMoneyAsNumber(BSTRbstrName,VARIANTvtDefault,VARIANTvtMin,VARIANTvtMax,VARIANTvtLocale,VARIANT*pvtRet);

Parameters

bstrName

[in] A BSTR that contains the name of the URL query string or form post variable to retrieve.

vtDefault

[in, optional] A VARIANT that contains the value to return if the requested URL query string or form post variable is not present or contains no value. If this parameter is not supplied, the method returns NULL. If the default value is a string value, it will be converted into the base monetary value, otherwise, it is assumed that the value is in base monetary units.

vtMin

[in, optional] A VARIANT that contains the monetary value that specifies the low end of the range against which to validate the converted value. A value in base monetary units is expected for the vtMin parameter. If the converted value is less than vtMin, then NULL is returned.

vtMax

[in, optional] A VARIANT that contains the monetary value that specifies the high end of the range against which to validate the converted value. If the variant is of type VT_NULL, the vtMax parameter value is not considered in the validation process. A value in base monetary units is expected for the vtMax parameter. If the converted value is greater than vtMax, then NULL is returned.

vtLocale

[in, optional] A VARIANT that contains the number that specifies the locale to use to convert the bstrName parameter. If this parameter is not used, the RequestMoneyAsNumber method uses the value of the Locale property of the DataFunctions object.

pvtRet

[out, retval] A pointer to a VARIANT used to return the number in the base monetary units of the specified or default locale. If any validation fails, the return value will be NULL.

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

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 points to valid data only if the method completed successfully. If any validation fails, the pvtRet parameter will be NULL.

If this method completes successfully it returns a number that represents the value of the specified string in the base monetary unit of the specified local. Thus, given a value in US dollars, it returns the number of cents in that value.

This method converts the specified String based on the locale specified in the vtLocale parameter if the vtLocale parameter is specified; otherwise it uses the default locale found in the DataFunctions object. It validates the result of the conversion against the vtMin and vtMax parameters, if they are specified. If the validation fails this method returns NULL.

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

See Also

AppFrameWork Object

IDataFunctions_4_0::get_Locale, put_Locale

IDataFunctions_4_0::ConvertMoneyStringToNumber

IDataFunctions_4_0::Money

IAppFrameWork::RequestFloat

IAppFrameWork::RequestNumber


All rights reserved.