<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Proper way to subclass CXTPToolBar with member var</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Proper way to subclass CXTPToolBar with member var]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 21:52:59 +0000</pubDate>
  <lastBuildDate>Mon, 12 Mar 2012 14:44:03 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=19571</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Proper way to subclass CXTPToolBar with member var :   Hello, I have created a subclassed...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19571&amp;PID=67796&amp;title=proper-way-to-subclass-cxtptoolbar-with-member-var#67796</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7312">cuisinart</a><br /><strong>Subject:</strong> 19571<br /><strong>Posted:</strong> 12 March 2012 at 2:44pm<br /><br /><div><br></div><div>&nbsp;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). &nbsp;It stores pointers to its controls as member variables, and handles LButtonDown clicks and HScrolls from user input. &nbsp;Also, it's dyn declared with the&nbsp;macros&nbsp;<font size="2" style="line-height: normal; font-size: small; ">DECLARE_XTP_COMMANDBAR and&nbsp;</font><span style="line-height: normal; font-size: small; ">IMPLEMENT_XTP_COMMANDBAR&nbsp;</span>as mentioned on this forum.</div><div><br></div><div>&nbsp; &nbsp; 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. &nbsp;I read on the forum that the Copy member function needs to be over-ridden, so I did this but it is never called.</div><div><br></div><div>&nbsp;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. &nbsp;However this isn't optimal..</div><div><br></div><div>&nbsp; What is the <em>proper</em> 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?</div>]]>
   </description>
   <pubDate>Mon, 12 Mar 2012 14:44:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19571&amp;PID=67796&amp;title=proper-way-to-subclass-cxtptoolbar-with-member-var#67796</guid>
  </item> 
 </channel>
</rss>