Partager via


CComCurrency::operator =

This operator assigns the CComCurrency object to a new value.

const CComCurrency & operator =(
   const CComCurrency & curSrc 
) throw( );
const CComCurrency & operator =(
   CURRENCY cySrc 
) throw( );
const CComCurrency & operator =(
   FLOAT fSrc 
);
const CComCurrency & operator =(
   SHORT sSrc 
);
const CComCurrency & operator =(
   LONG lSrc 
);
const CComCurrency & operator =(
   BYTE bSrc 
);
const CComCurrency & operator =(
   USHORT usSrc 
);
const CComCurrency & operator =(
   DOUBLE dSrc 
);
const CComCurrency & operator =(
   CHAR cSrc 
);
const CComCurrency & operator =(
   ULONG ulSrc 
);
const CComCurrency & operator =(
   DECIMAL dSrc 
);

Parameters

  • curSrc
    A CComCurrency object.

  • cySrc
    A variable of type CURRENCY.

  • sSrc, fSrc, lSrc, bSrc, usSrc, dSrc, cSrc, ulSrc, dSrc
    The numeric value to assign to the CComCurrency object.

Return Value

Returns the updated CComCurrency object. In the event of an error, such as an overflow, this operator calls AtlThrow with an HRESULT describing the error.

Example

CComCurrency cur1, cur2(10, 5000);
CURRENCY cy;

// Copying one object to another 
cur1 = cur2;

// Using the CURRENCY data type
cy.int64 = 105000;
cur1 = cy;

ATLASSERT(cur1 == cur2);

Requirements

Header: atlcur.h

See Also

Reference

CComCurrency Class

Other Resources

CComCurrency Members