<?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 : How to add menu item in OnInitCommandsPopup()</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : How to add menu item in OnInitCommandsPopup()]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 10 Jun 2026 11:37:33 +0000</pubDate>
  <lastBuildDate>Fri, 26 Jan 2007 10:58:11 +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=6129</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[How to add menu item in OnInitCommandsPopup() : I ended up looking at their DynamicPopups...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19760&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19760</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2708">jjwalters</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 26 January 2007 at 10:58am<br /><br />I ended up looking at their DynamicPopups example, and this does exactly what I want.<DIV></DIV>It is a real shame that there are no docs to explain all this, or at least to advise on which sample to look at.<DIV>Thanks for your time Mike.</DIV>]]>
   </description>
   <pubDate>Fri, 26 Jan 2007 10:58:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19760&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19760</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : Dear JJ,  Below,is the solution...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19756&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19756</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 26 January 2007 at 9:48am<br /><br />Dear JJ,<DIV>&nbsp;</DIV><DIV>Below,&nbsp;is the solution that I had cooked up before Oleg showed me the simpler solution. This is a standard technique I've used before to access protected members. And you are right: The Codejock code is great but the docs really could use some&nbsp;improvement for&nbsp;showing a developer how to implement it.</DIV><DIV>&nbsp;</DIV><DIV>Michael</DIV><DIV>&nbsp;</DIV><DIV>--------------------</DIV><DIV>&nbsp;</DIV><DIV>#include "C:\Program Files\Codejock Software\MFC\Xtreme ToolkitPro v10.3.1\Source\CommandBars\XTPCommandBar.h"</DIV><DIV>&nbsp;</DIV><DIV>class CXTPCommandBarSpoof : public CXTPCommandBar&nbsp; <BR>{<BR>public:<BR>&nbsp; CXTPCommandBarSpoof( CXTPCommandBar* pOldCommandBar );<BR>&nbsp; virtual ~CXTPCommandBarSpoof();</DIV><DIV>public:<BR>&nbsp; UINT GetDocTemplate();<BR>};</DIV><DIV>&nbsp;</DIV><DIV>// use Copy constructor to load class info</DIV><DIV>CXTPCommandBarSpoof::CXTPCommandBarSpoof( CXTPCommandBar* pOldCommandBar )<BR>{<BR>&nbsp; Copy( pOldCommandBar );<BR>}<BR>CXTPCommandBarSpoof::~CXTPCommandBarSpoof() {}</DIV><DIV>&nbsp;</DIV><DIV>// return the protected&nbsp;data as public</DIV><DIV>UINT CXTPCommandBarSpoof::GetDocTemplate() { return GetActiveDocTemplate(); }</DIV><DIV>&nbsp;</DIV><DIV>// implement spoof class in&nbsp;CMainFrame popup handler</DIV><DIV>void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar)<BR>{<BR>&nbsp; if ( ! sPopup.CompareNoCase(_T("PopupName")) )&nbsp;// caption of popup menu to change<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; CXTPControls* pCommandList = pCommandBar-&gt;GetControls();<BR>&nbsp;&nbsp;&nbsp; if ( pCommandList )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPCommandBarSpoof CB( pCommandBar );&nbsp;// spoof class to get the DocTemplate</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch( CB.GetDocTemplate() )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case IDR_MYDOC_TYPE:&nbsp;// ID of document template that owns&nbsp;popup<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // change menu items here<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR>}<BR></DIV>]]>
   </description>
   <pubDate>Fri, 26 Jan 2007 09:48:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19756&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19756</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : Solution sent From CodeJock Support:  Hello,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19754&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19754</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 26 January 2007 at 8:44am<br /><br />Solution sent From CodeJock Support:<DIV>&nbsp;</DIV><DIV>Hello, <DIV>&nbsp;</DIV><DIV>Call GetCommandBars()-&gt;GetActiveDocTemplate() method instead.</DIV></DIV>]]>
   </description>
   <pubDate>Fri, 26 Jan 2007 08:44:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19754&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19754</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : Hi Mike I&amp;#039;d love to know...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19751&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19751</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2708">jjwalters</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 26 January 2007 at 7:57am<br /><br />Hi Mike<DIV>I'd love to know how you added a menu item - no matter how inappropriate.&nbsp; CodeJock's docs are rather useless, and the Admin's comments above are unhelpful and unprofessional.......and we're paying a licence fee!!???</DIV>]]>
   </description>
   <pubDate>Fri, 26 Jan 2007 07:57:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19751&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19751</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : OK, I solved it. Rather arcane,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19420&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19420</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 16 January 2007 at 4:23pm<br /><br />OK, I solved it.&nbsp; Rather arcane, but it works.<DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>&nbsp;</DIV><DIV>Michael</DIV>]]>
   </description>
   <pubDate>Tue, 16 Jan 2007 16:23:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19420&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19420</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : Oleg,  Of course, the first...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19406&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19406</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 16 January 2007 at 10:06am<br /><br />Oleg,<DIV>&nbsp;</DIV><DIV>Of course, the first place I looked for the answer was in the Notifications example. It does not show how to ADD a menu item. It shows how to remove and rename menu items. I wasnt to add *new* items with name and message ID to be determined.</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>&nbsp;</DIV><DIV>Michael</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 16 Jan 2007 10:06:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19406&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19406</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : hi, See Notfications sample and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19396&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19396</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 16 January 2007 at 6:26am<br /><br /><P>hi,</P><DIV>See Notfications sample and CXTPControls methods.</DIV>]]>
   </description>
   <pubDate>Tue, 16 Jan 2007 06:26:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19396&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19396</guid>
  </item> 
  <item>
   <title><![CDATA[How to add menu item in OnInitCommandsPopup() : I wantto add specific menu items...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19387&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19387</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 6129<br /><strong>Posted:</strong> 15 January 2007 at 4:47pm<br /><br />I want&nbsp;to add specific menu items to a menu at run time, so I am handling <FONT color=#0000ff>OnInitCommandsPopup</FONT>() in place of the MFC <FONT color=#0000cc>OnInitmenupopup</FONT>(). I don;t see hpow this can be done. There's a <FONT color=#0000cc>Remove </FONT>method but no <FONT color=#0000cc>Add </FONT>method that I can see doing the job.<DIV>&nbsp;</DIV><DIV>I've looked in the source and samples and I just cannot find an example or docs on this anywhere.</DIV><DIV>&nbsp;</DIV><DIV>Michael</DIV>]]>
   </description>
   <pubDate>Mon, 15 Jan 2007 16:47:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6129&amp;PID=19387&amp;title=how-to-add-menu-item-in-oninitcommandspopup#19387</guid>
  </item> 
 </channel>
</rss>