User (Legacy) Posted November 14, 2003 Report Share Posted November 14, 2003 Hi, I'm trying to set a subcommand on the toolbar's style, but having trouble or-ing multiple styles together: I want to do this: m_pChartFX->Commands->Item[2]->Style = (CBIS_GROUPHEAD|CBIS_NOIMAGE); But the only way I can get it to work is to cast it to: m_pChartFX->Commands->Item[2]->Style = (__MIDL___MIDL_itf_sfxbar_0000_0005)(CBIS_GROUPHEAD|CBIS_NOIMAGE); Which may be dangerous. I tried casting to (CfxStyle), but no luck. I searched the docs, knowledgebase, and newsgroups, but haven't found an example in C++ that will help. Thanks, Tim Link to comment Share on other sites More sharing options...
Software FX Posted November 17, 2003 Report Share Posted November 17, 2003 The right way would be: m_pChartFX->Commands->Item[2]->Style = (CommandItemStyle) (CBIS_GROUPHEAD|CBIS_NOIMAGE); When you do an "or" (|) of two enums, the result is an integer, that's why the cast is necessary. -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
User (Legacy) Posted November 17, 2003 Author Report Share Posted November 17, 2003 Thanks, Wasn't sure what the right cast was. Tim "SoftwareFX Support" <support@softwarefx.com> wrote in message news:dSgeloRrDHA.1900@WEBSERVER1... > The right way would be: > > m_pChartFX->Commands->Item[2]->Style = (CommandItemStyle) > (CBIS_GROUPHEAD|CBIS_NOIMAGE); > > When you do an "or" (|) of two enums, the result is an integer, that's why > the cast is necessary. > > -- > 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.