Jump to content
Software FX Community

Sub Item Style in C++


User (Legacy)
 Share

Recommended Posts

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

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...