COleCurrency::operator =
const COleCurrency& operator =( CURRENCY cySrc );
const COleCurrency& operator =( const COleCurrency& curSrc );
const COleCurrency& operator =( const VARIANT& varSrc );
Remarks
These overloaded assignment operators copy the source currency value into this COleCurrency object. A brief description of each operator follows:
operator =( cySrc ) The value is copied into the COleCurrency object and its status is set to valid.
operator =( curSrc ) The value and status of the operand, an existing COleCurrency object are copied into this COleCurrency object.
operator =( varSrc ) If the conversion of the value (or COleVariant object) to a currency (VT_CY) is successful, the converted value is copied into this COleCurrency object and its status is set to valid. If the conversion is not successful, the value of the COleCurrency object is set to 0 and its status to invalid.
For more information, see the and entries in the Win32 SDK OLE Programmer’s Reference.
Example
// set to 35.0050
COleCurrency cur1(35, 50);
COleCurrency cur2;
// operator= copies COleCurrency types
cur2 = cur1;
ASSERT(cur1 == cur2);
// can be used to assign a CURRENCY type, as well
CURRENCY cy;
cy.Hi = 0;
cy.Lo = 350050;
cy.int64 = 350050;
// perform assignment
COleCurrency cur3;
cur3 = cy;
ASSERT(cur3 == cur1);
COleCurrency Overview | Class Members | Hierarchy Chart
See Also COleCurrency::COleCurrency, COleCurrency::SetCurrency, COleCurrency::GetStatus