<?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 : CXTPCommandBar::LoadMenu Causing crash</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : CXTPCommandBar::LoadMenu Causing crash]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 23:47:33 +0000</pubDate>
  <lastBuildDate>Mon, 20 Feb 2006 10:38:36 +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=3650</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[CXTPCommandBar::LoadMenu Causing crash : Hello, I guess you can catch ...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=11071&amp;title=cxtpcommandbarloadmenu-causing-crash#11071</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 20 February 2006 at 10:38am<br /><br /><P>Hello,</P><P>I guess you can catch</P><P>ON_XTP_INITCOMMANDSPOPUP()<BR></P><P>void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar)<BR>{</P><P>if ThisIsMyPopup(pCommandBar&nbsp;)<BR>{</P><P>&nbsp;&nbsp; pCommandBar-&gt;LoadMenu(&amp;TempMenu,TRUE);<BR><BR>}</P><P>}</P><P>it will update menu before user&nbsp;popup it.</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Mon, 20 Feb 2006 10:38:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=11071&amp;title=cxtpcommandbarloadmenu-causing-crash#11071</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPCommandBar::LoadMenu Causing crash : Does anyone have any ideas how...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=11048&amp;title=cxtpcommandbarloadmenu-causing-crash#11048</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1787">MarkIRS</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 17 February 2006 at 3:18pm<br /><br />Does anyone have any ideas how to do this?&nbsp; Basically I'm looking for information on how to repopulate a pupup menu at a given point while our program is running?<br><br>I've taken a look at the Dyamic Menu sample, but I cannot seem to get it working for a popup menu (CXTPPopupBar)?<br><br>Any help with this would be appreciated.<br>]]>
   </description>
   <pubDate>Fri, 17 Feb 2006 15:18:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=11048&amp;title=cxtpcommandbarloadmenu-causing-crash#11048</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPCommandBar::LoadMenu Causing crash :  Hi Oleg,Thats interesting, so we...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10999&amp;title=cxtpcommandbarloadmenu-causing-crash#10999</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1787">MarkIRS</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 15 February 2006 at 8:45am<br /><br /><p style="margin-bottom: 0in;">Hi Oleg,<br><br>Thats interesting, sowe shouldn't be storing m_pLayoutsPopupBar?&nbsp; <br><br>How thenshould we be reloading the menu when we need to?&nbsp; As explainedabove when the user wants to save a layout, we re-create the menu(with the new addition) and then load it into m_pLayoutsPopupBar.&nbsp;If we don't keep a pointer to m_pLayoutsPopupBar, how do we load ournew menu?<br><br>Also what do we do about freeing the memory used tocreate m_pLayoutsPopupBar?</p><p style="margin-bottom: 0in;">Thanks for your help!</p>]]>
   </description>
   <pubDate>Wed, 15 Feb 2006 08:45:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10999&amp;title=cxtpcommandbarloadmenu-causing-crash#10999</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPCommandBar::LoadMenu Causing crash : Hello, It is very bad idea to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10994&amp;title=cxtpcommandbarloadmenu-causing-crash#10994</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 15 February 2006 at 7:56am<br /><br /><P>Hello,</P><P>It is very bad idea to store pointer m_pLayoutsPopupBar. - it will be corrupted if you Load previous state of commandbars or user made customization and delete some controls with this popup. (guess it is the reason that m_pControls is NULL)</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Wed, 15 Feb 2006 07:56:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10994&amp;title=cxtpcommandbarloadmenu-causing-crash#10994</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPCommandBar::LoadMenu Causing crash :  Hi Oleg,Thanks for replying...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10977&amp;title=cxtpcommandbarloadmenu-causing-crash#10977</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1787">MarkIRS</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 14 February 2006 at 3:52pm<br /><br /><p style="margin-bottom: 0in;">Hi Oleg,<br><br>Thanks for replying tomy post, I've been trying to replicate this in a simple program orusing one of your sample applications but I've been having a bit of aproblem replicating it.<br><br>Basically what we are doing is using aLoadMenu() function on a CXTPPopupBar* pointer that was created asfollows:<br><br><table width="99%"><tr><td><pre class="BBcode">m_pLayoutsPopupBar =CXTPPopupBar::CreatePopupBar(GetCommandBars());</pre></td></tr></table><br><br>We thendynamically re-populate m_pLayoutsPopupBar is the user has saved anew layout.&nbsp; To repopulate m_pLayoutsPopupBar we create atemporary CMenu, and then call the following to load the newmenu:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>m_pLayoutsPopupBar-&gt;LoadMenu(&amp;TempMenu,TRUE);<br></pre></td></tr></table><br><br>Thisworks fine the first time through, but the next time through them_pControls member variable is invalid and the LoadMenu functioncauses a crash.<br><br>I have been able to avoid the crash using thefollowing code:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CXTPControls* pControls =m_pLayoutsPopupBar-&gt;GetControls();<br>&nbsp;&nbsp;&nbsp; if((pControls)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&amp;&amp;(AfxIsValidAddress(pControls<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , sizeof(CXTPControls), FALSE)))<br></pre></td></tr></table><br><br>Butthat does not make my menu work.&nbsp; What I'm having troubleunderstanding is how m_pControls, a private member variable, isgetting corrupted?<br><br>I will keep trying to replicate it in asample app, and if I am successful I will send you that.&nbsp;Hopefully in the mean time the above explanation will give you someideas as to what the problem maybe.<br><br>Also, we are using VisualStudio 6.0, MFC, and version 9.80 of your library. </p>]]>
   </description>
   <pubDate>Tue, 14 Feb 2006 15:52:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10977&amp;title=cxtpcommandbarloadmenu-causing-crash#10977</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPCommandBar::LoadMenu Causing crash : Hello, We need sample application...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10967&amp;title=cxtpcommandbarloadmenu-causing-crash#10967</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 14 February 2006 at 11:16am<br /><br /><P>Hello,</P><P>We need sample application from you to see what you try to do.</P>]]>
   </description>
   <pubDate>Tue, 14 Feb 2006 11:16:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10967&amp;title=cxtpcommandbarloadmenu-causing-crash#10967</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPCommandBar::LoadMenu Causing crash :  Hi Everyone,I&amp;#039;m getting...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10959&amp;title=cxtpcommandbarloadmenu-causing-crash#10959</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1787">MarkIRS</a><br /><strong>Subject:</strong> 3650<br /><strong>Posted:</strong> 14 February 2006 at 8:49am<br /><br /><p style="margin-bottom: 0in;">Hi Everyone,<br><br>I'm getting a crashin our program when we run CXTPCommandBar::LoadMenu.&nbsp; Theproblem appears to be caused by the m_pControls, which is set to NULLat that time.<br><br>The LoadMenu function is being called because weare adding additional items (at runtime) to our CXTPPopupBar.&nbsp;Does anyone know what the problem might be?&nbsp; <br><br>I've alsonoticed that there was a similar <a href="https://forum.codejock.com/forum_posts.asp?TID=3123&amp;KW=LoadMenu" target="_blank">postabout this</a> here on the forums, does anyone know what the resultof that was? </p><br><br><br>]]>
   </description>
   <pubDate>Tue, 14 Feb 2006 08:49:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3650&amp;PID=10959&amp;title=cxtpcommandbarloadmenu-causing-crash#10959</guid>
  </item> 
 </channel>
</rss>