CComCurrency::operator =

此运算符分配给一个新值的 CComCurrency 对象。

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  
);

参数

  • curSrc
    CComCurrency 对象。

  • cySrc
    类型 CURRENCY的变量。

  • sSrc,fSrc,lSrc, bSrcusSrc,dSrc, cSrculSrc,dSrc
    分配给 CComCurrency 对象的数值。

返回值

返回更新 CComCurrency 对象。 在一个错误情况下,例如溢出,此运算符调用使用描述错误的HRESULT的 AtlThrow

示例

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);

要求

Header: atlcur.h

请参见

参考

CComCurrency Class