<?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 : Subclassing CXTPRibbonBar</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Subclassing CXTPRibbonBar]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 30 Apr 2026 21:07:38 +0000</pubDate>
  <lastBuildDate>Wed, 16 May 2007 21:43:47 +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=7140</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[Subclassing CXTPRibbonBar : &amp;#034;The message map shown in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7140&amp;PID=22966&amp;title=subclassing-cxtpribbonbar#22966</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2853">Rhogan</a><br /><strong>Subject:</strong> 7140<br /><strong>Posted:</strong> 16 May 2007 at 9:43pm<br /><br /> <img src="http://forum.codejock.com/smileys/smiley2.gif" border="0" align="middle"> "The message map shown in the source code is just a stripped down version of the original, which actually features ON_WM_CREATE()."  Or at least, that is what I was about to post until I looked at the actual source file and -- bingo -- you got it right, ON_WM_CREATE() was missing.  Thank you for unsticking my brain there.  <br /><br /> <img src="http://forum.codejock.com/smileys/smiley32.gif" border="0" align="middle"> ]]>
   </description>
   <pubDate>Wed, 16 May 2007 21:43:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7140&amp;PID=22966&amp;title=subclassing-cxtpribbonbar#22966</guid>
  </item> 
  <item>
   <title><![CDATA[Subclassing CXTPRibbonBar : Hi,  OnCreate never called because...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7140&amp;PID=22923&amp;title=subclassing-cxtpribbonbar#22923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 7140<br /><strong>Posted:</strong> 16 May 2007 at 5:55am<br /><br /><DIV>Hi,</DIV><DIV>&nbsp;</DIV><DIV>OnCreate never called because you didn't add ON_WM_CREATE() in message map.</DIV><DIV>e.</DIV>]]>
   </description>
   <pubDate>Wed, 16 May 2007 05:55:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7140&amp;PID=22923&amp;title=subclassing-cxtpribbonbar#22923</guid>
  </item> 
  <item>
   <title><![CDATA[Subclassing CXTPRibbonBar : I would like to create a subclass...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7140&amp;PID=22895&amp;title=subclassing-cxtpribbonbar#22895</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2853">Rhogan</a><br /><strong>Subject:</strong> 7140<br /><strong>Posted:</strong> 15 May 2007 at 12:52pm<br /><br />I would like to create a subclass of CXTPRibbonBar with its own message map so it can create itself and handle the message processing.  Yes, I can have my main window do all this, but I prefer to work things in this manner.  I have most things working, but not having used MFC for a few years, I forget how to get my message map working.  I could post my code here, but perhaps it is better if some tech would just post some brief tips.  Here is some of my code.  Please advise on how to get things working so the message map works and constructor will create the ribbon groups without giving an exception:<br /><br />class _XTP_EXT_CLASS CRibbon: public CXTPRibbonBar<br />{<br />  DECLARE_DYNCREATE(CRibbon)<br />  DECLARE_MESSAGE_MAP()<br />public:<br />  CRibbon();<br />  int OnCreate(LPCREATESTRUCT lpCreateStruct);<br />  bool Init();<br />protected: // message map functions<br />  afx_msg void OnRibbonTabChanged(NMHDR*, LRESULT*);<br />};<br /><br />IMPLEMENT_DYNCREATE(CRibbon, CXTPRibbonBar)<br /><br />BEGIN_MESSAGE_MAP(CRibbon, CXTPRibbonBar)<br />  ON_NOTIFY(TCN_SELCHANGE, XTP_ID_RIBBONCONTROLTAB, OnRibbonTabChanged)<br />END_MESSAGE_MAP()<br /><br />CRibbon::CRibbon()<br />{<br />  TRACE("CRibbon constructor\n");<br />  // unable to create ribbon elemtns here else exception<br />}<br /><br />int CRibbon::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />{<br />  // this function is never called; surprising<br /><br />  if (CXTPRibbonBar::OnCreate(lpCreateStruct) == -1)<br />&nbsp;&nbsp;&nbsp;&nbsp;return -1;<br /><br />  // I notice source uses SetupHook() here; do I need it?<br /><br />  return 0;<br />}<br /><br />// my main window calls pRibbon-&gt;Init() after<br />// creating object since constructor cannot create<br />// elements without giving exception<br />bool CRibbon::Init()<br />{<br />  CMainFrame* pMainFrame = (CMainFrame*) AfxGetMainWnd();<br />  CXTPCommandBars* pBars = pMainFrame-&gt;GetCommandBars();<br /><br />  // start creating everything...<br />}]]>
   </description>
   <pubDate>Tue, 15 May 2007 12:52:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7140&amp;PID=22895&amp;title=subclassing-cxtpribbonbar#22895</guid>
  </item> 
 </channel>
</rss>