Wednesday, May 2, 2012

How can I convert from LONGLONG to class _variant_t?

In this example m_Amount is CString. stringToNumber function converts it to a LONGLONG number successfully. But when I want to assign it to a variant I get this error:

error C2440: 'type cast' : cannot convert from '__int64' to 'class _variant_t'


_variant_t  myVar = _variant_t( (LONGLONG)stringToNumber(m_Amount) );

No comments:

Post a Comment