CComCurrency::CComCurrency
Visual Studio 2012
The constructor.
CComCurrency( ) throw( ); CComCurrency( const CComCurrency& curSrc ) throw( ); CComCurrency( CURRENCY cySrc ) throw( ); CComCurrency( DECIMAL dSrc ); CComCurrency( ULONG ulSrc ); CComCurrency( USHORT usSrc ); CComCurrency( CHAR cSrc ); CComCurrency( DOUBLE dSrc ); CComCurrency( FLOAT fSrc ); CComCurrency( LONG lSrc ); CComCurrency( SHORT sSrc ); CComCurrency( BYTE bSrc ); CComCurrency( LONGLONG nInteger, SHORT nFraction ); explicit CComCurrency( LPDISPATCH pDispSrc ); explicit CComCurrency( const VARIANT& varSrc ); explicit CComCurrency( LPCWSTR szSrc ); explicit CComCurrency( LPCSTR szSrc );
The constructor sets the initial value of CComCurrency::m_currency, and accepts a wide range of data types, including integers, strings, floating-point numbers, CURRENCY variables, and other CComCurrency objects. If no value is provided, m_currency is set to 0.
In the event of an error, such as an overflow, the constructors lacking an empty exception specification (throw()) call AtlThrow with an HRESULT describing the error.
When using floating-point or double values to assign a value, note that CComCurrency(10.50) is equivalent to CComCurrency(10,5000) and not CComCurrency(10,50).