<?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 : SetMenu does not work ?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : SetMenu does not work ?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 12 Apr 2026 13:34:00 +0000</pubDate>
  <lastBuildDate>Fri, 13 Feb 2004 10:25:39 +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=440</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[SetMenu does not work ? : Hi,  I figure out how to do it...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=440&amp;PID=1014&amp;title=setmenu-does-not-work#1014</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=360">coradinibr</a><br /><strong>Subject:</strong> 440<br /><strong>Posted:</strong> 13 February 2004 at 10:25am<br /><br /><P>Hi, </P><P>I figure out how to do it !</P><P>SetMenu does not work because it can be created only 1 time (the first time object is created).<BR>We must use LoadMenu() for it !</P><P>Simple example:</P><P>CMenu menu;<BR>menu.LoadMenu(MY_MENU);</P><P>CXTPCommandBars* pCommandBar;<BR>CXTPToolBar*&nbsp;&nbsp;&nbsp;&nbsp; pToolBar = NULL;<BR>CXTPMenuBar*&nbsp;&nbsp; pMenuBar;<BR>pCommandBar = GetCommandBars();<BR>pMenuBar = pCommandBar-&gt;GetMenuBar();<BR>pMenuBar-&gt;LoadMenu(&amp;menu);<BR></P><P>Bye</P><P>Evandro Coradini</P>]]>
   </description>
   <pubDate>Fri, 13 Feb 2004 10:25:39 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=440&amp;PID=1014&amp;title=setmenu-does-not-work#1014</guid>
  </item> 
  <item>
   <title><![CDATA[SetMenu does not work ? : Hi, I need to change the menu...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=440&amp;PID=1010&amp;title=setmenu-does-not-work#1010</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=360">coradinibr</a><br /><strong>Subject:</strong> 440<br /><strong>Posted:</strong> 12 February 2004 at 2:19pm<br /><br /><P>Hi,</P><P>I need to change the menu based on the context of my application.</P><P>I have tried to change it by the conventional way, but it doesn't work !</P><P>I did the following :</P><P>1) Create a static CMenu member in My CMDIChildWnd my class where&nbsp;I can load the menu resources that&nbsp;I want.</P><P>2) On the OnCreate function I load the resource menu and call SetMenu to change it.</P><P>&nbsp;</P><P>// part of the code </P><P>// s_menu is the static member !</P><P>&nbsp;menu.LoadMenu(IDR_MY_MENU_RESOURCE);<BR>&nbsp;m_hMenuShared = menu.m_hMenu; // set the menu for all windows </P><P>// get the CommandBar created in the CMainFrame</P><P>&nbsp;CXTPCommandBars* pCommandBar = theApp.m_pMainFrame-&gt;GetCommandBars();<BR></P><P>// get the menu attached to it</P><P>CXTPMenuBar* pMenuBar = pCommandBar-&gt;GetMenuBar();</P><P>//&nbsp;load the new menu</P><P>&nbsp;pMenuBar-&gt;SetMenu(&amp;menu);<BR></P><P>&nbsp;</P><P>I get no ASSERT or errors.</P><P>The menu appears to load, but it appears on the border of the old menu.</P><P>When I try to access the menu itens, the menu change to the old one.</P><P>I'm using XTPro.</P><P>&nbsp;</P><P>Thanks</P><P>Evandro Coradini</P>]]>
   </description>
   <pubDate>Thu, 12 Feb 2004 14:19:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=440&amp;PID=1010&amp;title=setmenu-does-not-work#1010</guid>
  </item> 
 </channel>
</rss>