Click to See Complete Forum and Search --> : COleCurrency: How do I multiply?


May 30th, 1999, 02:39 AM
How do I muliply one currency variable with another. As when I do m_Amount = m_1 * m_2 it gives me :

binary '*' : no opera no operator defined which takes a right-hand operand of type 'class COleCurrency' (or there is no acceptable conversion)

It will add up properly m_1 + m_2, but will not multiply.

Hurol Aslan
May 31st, 1999, 01:29 PM
Hello,

A COleCurrency object actually hides a CURRENCY type variable. You can multiply them, if you like. Check the class definition or data members of COLeCurrency from the VC++ help.

Wayne Fuller
May 31st, 1999, 01:43 PM
I have not used the COleCurrency class before but if you have
two CURRENCY structures to multiply them is as follows:
CY cyLeft;
CY cyRight;
CY cyProduct;

VarCyMul(cyLeft, cyRight, &cyProduct);



Hope that helps,

Wayne