<?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 : Changing menu at runtime</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Changing menu at runtime]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 05:40:47 +0000</pubDate>
  <lastBuildDate>Thu, 24 Nov 2005 20:42:54 +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=3269</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[Changing menu at runtime : I solved this by doing something...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3269&amp;PID=9777&amp;title=changing-menu-at-runtime#9777</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1602">wal33604</a><br /><strong>Subject:</strong> 3269<br /><strong>Posted:</strong> 24 November 2005 at 8:42pm<br /><br />I solved this by doing something similar to the following:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CXTPCommandBars* pCommandBars = m_mainFrame-&gt;GetCommandBars();<br>int barCount = pCommandBars-&gt;GetCount();<br>int seed = 0;<br>for ( int i = 0; i &lt; barCount; ++i )<br>{<br>&nbsp; CXTPToolBar* pToolBar = pCommandBars-&gt;GetAt( seed );<br>&nbsp; if ( pToolBar-&gt;GetType() == xtpBarTypeMenuBar )<br>&nbsp;&nbsp;&nbsp; ++seed;<br>&nbsp; else<br>&nbsp; &nbsp; pCommandBars-&gt;Remove( pToolBar );<br>}<br> pCommandBars-&gt;GetMenuBar()-&gt;GetControls()-&gt;RemoveAl l();<br></pre></td></tr></table><br><br>Rather than using SetMenu to swap the menu I used<br><table width="99%"><tr><td><pre class="BBcode"><br>pCommandBars-&gt;GetMenuBar()-&gt;LoadMenuBar( IDR_MENU );<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Thu, 24 Nov 2005 20:42:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3269&amp;PID=9777&amp;title=changing-menu-at-runtime#9777</guid>
  </item> 
  <item>
   <title><![CDATA[Changing menu at runtime :  Using Xtreme Toolkit Pro 9.51I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3269&amp;PID=9765&amp;title=changing-menu-at-runtime#9765</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1602">wal33604</a><br /><strong>Subject:</strong> 3269<br /><strong>Posted:</strong> 24 November 2005 at 7:40am<br /><br />Using Xtreme Toolkit Pro 9.51<br><br>I am working on an application that must change modes at runtime (meaning the menu and toolbars must be completely swapped). I first remove the current menu and toolbars using code similar to the following:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CXTPCommandBars* pCommandBars = m_mainFrame-&gt;GetCommandBars();<br>int barCount = pCommandBars-&gt;GetCount();<br>for ( int i = 0; i &lt; barCount; ++i )<br>{<br>&nbsp; pCommandBars-&gt;Remove( pCommandBars-&gt;GetAt( 0 ) );<br>}<br></pre></td></tr></table><br><br>This works all fine and well. However, when I go to set a new menu using CXTPCommandBars::SetMenu() I get a debug assertion on line 134 of XTPCommandBars.cpp where it checks to see of the CXTPMenuBar* is NULL. The program continues producing the desired results after the assertion.<br><br>My questions:<br>Is this is something that can be ignored since the error won't be produced in a Release build (although it will get annoying while debugging).<br>Is there way to do what I need to do that will not produce the assertion?<br><br><br>]]>
   </description>
   <pubDate>Thu, 24 Nov 2005 07:40:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3269&amp;PID=9765&amp;title=changing-menu-at-runtime#9765</guid>
  </item> 
 </channel>
</rss>