User (Legacy) Posted March 20, 2002 Report Share Posted March 20, 2002 Hi, All: I used the following code to change the format of axis: m_pChartFX->Axis->Item[AXIS_X]->Format=AF_SCIENTIFIC; And I got the error as follows: error C2664: 'PutFormat' : cannot convert parameter 1 from 'enum CfxFormat' to 'const class _variant_t &' Reason: cannot convert from 'enum CfxFormat' to 'const class _variant_t' No constructor could take the source type, or constructor overload resolution was ambiguous When I tried: m_pChartFX->Axis->Item[AXIS_Y]->Format=(const class _variant_t) AF_SCIENTIFIC; I got error C2440: 'type cast' : cannot convert from 'enum CfxFormat' to 'const class _variant_t' No constructor could take the source type, or constructor overload resolution was ambiguous Can any one tell me how to convert the required type for setting the format of any axis? Danqing Link to comment Share on other sites More sharing options...
Software FX Posted March 20, 2002 Report Share Posted March 20, 2002 VC++ will not automatically convert an enumeration to a variant, do: m_pChartFX->Axis->Item[AXIS_X]->Format= (short)AF_SCIENTIFIC; And you'll get it ! -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.