Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - [SOLVED](ribbonbar) pointers no more persistent!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED](ribbonbar) pointers no more persistent!!

 Post Reply Post Reply
Author
Message
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED](ribbonbar) pointers no more persistent!!
    Posted: 05 June 2014 at 11:37am
How did you thought to works??

Try this!
  • Add controls to ribbon bar and save this pointer (result of Add)
  • Run app and resize application frame to minimum width
  • Now, the single controls should be groupped by parent button
  • click this button to popup/see your controls
  • Click on some button

If you now using your saved pointer, you see that this points to a freed memory block.

The reason is, that you frees the original controls!

                // we need to copy the popped ribbon group to the existing (in order not to lose user's changes)

                CXTPRibbonGroupPopupToolBar *pPopupToolbar = DYNAMIC_DOWNCAST(CXTPRibbonGroupPopupToolBar, m_pCommandBar);

                if (pPopupToolbar && pPopupToolbar->m_pRibbonGroup)
                {
                    m_pPopupGroup->RemoveAll();
                    m_pPopupGroup->Copy(pPopupToolbar->m_pRibbonGroup);
                }


I think, this problem is not implement correctly. Controls should force to move, not copy/duplicate, in other popups. It should be transparent where they should be displayed. It's the same control (e.g. button)!

Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2014 at 2:58am
This article is solved. I already get a response from codejock guys.
I had got it wrong.

Quote
You should rely on correct pointer values returned from Add only immediately after a call to Add in order to change control's properties, in all other cases you can always find a conrol's pointer by control's ID. As for the custom controls, they have to be built taking into account this behavior.


Although I am not happy about this Wink
In my opinion, it should be irrelevant for programmer where codejock displays the control (directly in ribbon bar or in a popup for any reason)

Thanks for response
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.