<?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 : Dynamically adding ribbon buttons and msgs</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Dynamically adding ribbon buttons and msgs]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 03 Apr 2026 20:35:53 +0000</pubDate>
  <lastBuildDate>Mon, 18 Jun 2007 01:41:14 +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=7389</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[Dynamically adding ribbon buttons and msgs : Hello,  It have work same in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7389&amp;PID=23741&amp;title=dynamically-adding-ribbon-buttons-and-msgs#23741</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 7389<br /><strong>Posted:</strong> 18 June 2007 at 1:41am<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>It have work same in Ribbon Application - controls send absolutelly same messages.</DIV><DIV>&nbsp;</DIV><DIV>You can also try catch WM_XTP_COMMAND in CMainFrame and route message to plugin.</DIV><DIV>wParam - ID of control</DIV><DIV>lParam - pointer to NMXTPCONTROL.</DIV>]]>
   </description>
   <pubDate>Mon, 18 Jun 2007 01:41:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7389&amp;PID=23741&amp;title=dynamically-adding-ribbon-buttons-and-msgs#23741</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamically adding ribbon buttons and msgs : I have an application that I&amp;#039;m...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7389&amp;PID=23723&amp;title=dynamically-adding-ribbon-buttons-and-msgs#23723</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1198">beatle</a><br /><strong>Subject:</strong> 7389<br /><strong>Posted:</strong> 16 June 2007 at 1:29pm<br /><br /><P>I have an application that I'm converting to use ribbon bars. The application loads up plug-ins DLL's and for each one adds a button to a ribbon bar. The code is as follows:</P><FONT size=2><P>CXTPCommandBars* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pCommandBars=pPlugInComponentContext-&gt;m_pCommandBars;</P><P>_ASSERTE(pCommandBars);</P><P>pCommandBars-&gt;GetImageManager()-&gt;SetIcons(m_ToolButtonIconID);</P><P>UINT uiGroupTOOLS&#091;&#093; = {m_ToolButtonID};</P><P>pCommandBars-&gt;GetImageManager()-&gt;SetIcons(m_ToolButtonIconID, uiGroupTOOLS, _countof(uiGroupTOOLS), CSize(32, 32));</P><P>CXTPToolBar* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pToolBar=pCommandBars-&gt;GetToolBar(1);</P><P>_ASSERTE(pToolBar);</P><P>CXTPRibbonBar* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pRibbonBar=</FONT><FONT color=#0000ff size=2>dynamic_cast</FONT><FONT size=2>&lt;CXTPRibbonBar* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2>&gt;(pToolBar);</P><P>_ASSERTE(pRibbonBar);</P><P>CXTPRibbonTab* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pRibbonTab=pRibbonBar-&gt;GetTab(4);</P><P>_ASSERTE(pRibbonTab);</P><P>CXTPRibbonGroups* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pRibbonGroups=pRibbonTab-&gt;GetGroups();</P><P>_ASSERTE(pRibbonGroups);</P><P>CXTPRibbonGroup* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pRibbonGroup=pRibbonGroups-&gt;GetAt(0);</P><P>_ASSERTE(pRibbonGroup);</P><P>CXTPControl* </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> pControl=pRibbonGroup-&gt;Add(xtpControlButton, m_ToolButtonID);</P><P>_ASSERTE(pControl);</P><P>pControl-&gt;SetFlags(xtpFlagManualUpdate);</P><P>pControl-&gt;SetEnabled(TRUE)</P><DIV></DIV><P>The first problem I had was the button wasn't enabled because there is no message handler, this is by design since I don't know where the messages are to be routed at compile time. So I used SetEnabled to enable the button. The problem I now face is getting messages. In the original application I trapped the WM_COMMAND messages in OnCmdMsg and looked for the ID (m_ToolButtonID), but in the ribbon application I get nothing.</P><DIV></DIV><DIV></DIV>Some help would be much appreciated, I have been struggling with this for nearly a week.<DIV></DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance.</DIV></FONT>]]>
   </description>
   <pubDate>Sat, 16 Jun 2007 13:29:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7389&amp;PID=23723&amp;title=dynamically-adding-ribbon-buttons-and-msgs#23723</guid>
  </item> 
 </channel>
</rss>