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 Quote 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.