Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Proper way to subclass CXTPToolBar with member var
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Proper way to subclass CXTPToolBar with member var

 Post Reply Post Reply
Author
Message
cuisinart View Drop Down
Groupie
Groupie


Joined: 31 January 2012
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuisinart Quote  Post ReplyReply Direct Link To This Post Topic: Proper way to subclass CXTPToolBar with member var
    Posted: 12 March 2012 at 2:44pm

 Hello, I have created a subclassed toolbar that adds its own CXTPControls in its OnCreate section, in order to keep this tidy and somewhat separate from MainFrm (no message processing in MainFrm from this toolbar).  It stores pointers to its controls as member variables, and handles LButtonDown clicks and HScrolls from user input.  Also, it's dyn declared with the macros DECLARE_XTP_COMMANDBAR and IMPLEMENT_XTP_COMMANDBAR as mentioned on this forum.

    All seems to go well, except when loading toolbar states, the codejock framework somehow duplicates and destroys the created controls that the member variables point to.  I read on the forum that the Copy member function needs to be over-ridden, so I did this but it is never called.

 For now, my solution has been to remove all controls and re-create them after the toolbar state has been loaded, so the controls are valid and the toolbar position is loaded from the last state.  However this isn't optimal..

  What is the proper way to subclass a self-contained CXTPToolBar with new member variables (pointers to its self-created controls) without adding a bunch of message handlers to CMainFrame?
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.234 seconds.