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
貨幣型別的變數。sSrc, fSrc, lSrc, bSrc, usSrc, dSrc, cSrc, ulSrc, 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