<?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 : Get CMenu from CXTPCommandBars?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Get CMenu from CXTPCommandBars?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 19 Apr 2026 20:02:02 +0000</pubDate>
  <lastBuildDate>Fri, 26 Mar 2004 12:40:13 +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=544</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[Get CMenu from CXTPCommandBars? : I don&amp;#039;t think there is a...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=544&amp;PID=1468&amp;title=get-cmenu-from-cxtpcommandbars#1468</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=350">vladsch</a><br /><strong>Subject:</strong> 544<br /><strong>Posted:</strong> 26 March 2004 at 12:40pm<br /><br /><P>I don't think there is a way to get a CMenu from the current state of the menu bar. </P><P>There is a member of CXTPMenuBar m_hMenuDefault that is a menu handle of the default menu loaded into the menu bar but it is set via:</P><P><table width="99%"><tr><td><pre class="BBcode">m_hMenuDefault = ::GetMenu(GetSite()-&gt;GetSafeHwnd());</pre></td></tr></table></P><P>So you can just get that yourself without the menu bar. </P><P>I don't think this is of help in your case. You can build up a menu from the Controls of the menu bar by reversing the proces of the LoadMenu function in XTPCommandBar.cpp.&nbsp;The function&nbsp;is very simple and straight forward, and would not be&nbsp;a very big job to write its reverse.</P><P>Unless you need to pass the CMenu* to a function out of your control it would probably be easier to rewrite your code to deal directly with the XTP classes and functions. Of course unless you don't want to be permanently married to the XTP implementation.&nbsp;</P><P>I did&nbsp;rewrite my code&nbsp;in terms of the XTP classes&nbsp;and it simplified&nbsp;my code enourmously.</P><P><BR>&nbsp;</P>]]>
   </description>
   <pubDate>Fri, 26 Mar 2004 12:40:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=544&amp;PID=1468&amp;title=get-cmenu-from-cxtpcommandbars#1468</guid>
  </item> 
  <item>
   <title><![CDATA[Get CMenu from CXTPCommandBars? :  How can I get a CMenu from an...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=544&amp;PID=1389&amp;title=get-cmenu-from-cxtpcommandbars#1389</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=359">dmetzler</a><br /><strong>Subject:</strong> 544<br /><strong>Posted:</strong> 18 March 2004 at 6:33pm<br /><br /><FONT size=2><FONT size=2><P>How can I get a CMenu from an existing menu bar?</P><P>CXTPCommandBars* pCommandBars = GetCommandBars();</P><P>CXTPCommandBar* pMenuBar = pCommandBars-&gt;GetMenuBar() ;</P><P>Now - how to get the CMenu object from the pMenuBar?</P><P>Thanks,</P><P>Don Metzler</P><P>&nbsp;</P></FONT></FONT>]]>
   </description>
   <pubDate>Thu, 18 Mar 2004 18:33:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=544&amp;PID=1389&amp;title=get-cmenu-from-cxtpcommandbars#1389</guid>
  </item> 
 </channel>
</rss>