<?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 : Unable to get the HANDLE of Menu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Unable to get the HANDLE of Menu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 03:55:24 +0000</pubDate>
  <lastBuildDate>Thu, 05 Apr 2007 05:57:20 +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=6797</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[Unable to get the HANDLE of Menu : Hi,  Thanks for reply.  I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6797&amp;PID=21702&amp;title=unable-to-get-the-handle-of-menu#21702</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2903">KumarCJ</a><br /><strong>Subject:</strong> 6797<br /><strong>Posted:</strong> 05 April 2007 at 5:57am<br /><br /><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">Hi,<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">Thanks for reply.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">I do not want to add or modify&nbsp;the Menu.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990000; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">I need to assign Menu Handle to diffrent shared document template</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"> such as Spliter Window, BookView etc...<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">Below code is defind in XYZ.h, for </SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990000; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">diffrent shared document template</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"> <o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">CSharedDocTemplate* m_pSplitWindowTempl;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Split Window<BR>CSharedDocTemplate* m_pBookTempl;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Book view</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">The below given code is in </SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990000; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">OnCreate() of MainFrame.cpp</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">, </SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">where we are assigning the Menu handle to diffrent shared document template.</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<BR>{</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">CXTPMenuBar*&nbsp;&nbsp;pMenuBar = pCommandBars-&gt;SetMenu(_T("Menu Bar"), IDR_MAINFRAME);</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;&nbsp;&nbsp; HMENU hMenu = GetMenu()-&gt;GetSafeHmenu();</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&#091;As you told, since CommandBar dose not hold HMENU, We are not getting hMenu&#093;</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;&nbsp;&nbsp; CXYZApp * pApp = (CXYZApp *)AfxGetApp();</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&#091;But we need to assign handle of menu for diffrent shared document template.&#093;</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;&nbsp;&nbsp; pApp-&gt;m_pSplitWindowTempl-&gt;m_hMenuShared = </SPAN><B><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-bidi-font-size: 12.0pt">hMenu</SPAN></B><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">;<BR>&nbsp;&nbsp;&nbsp; pApp-&gt;m_pBookTempl-&gt;m_hMenuShared = </SPAN><B><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-bidi-font-size: 12.0pt">hMenu</SPAN></B><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">; </SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: #990066; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">}</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">Since we are not getting "hMenu", we are unable to assign it to diffrent shared document template.</SPAN><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><B><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: red; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN; mso-bidi-font-size: 12.0pt">How we can assign handle of menu to diffrent shared document template.</SPAN></B><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">Thanks,<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN">KumarCJ<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Thu, 05 Apr 2007 05:57:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6797&amp;PID=21702&amp;title=unable-to-get-the-handle-of-menu#21702</guid>
  </item> 
  <item>
   <title><![CDATA[Unable to get the HANDLE of Menu : Hi, CommandBars don&amp;#039;t hold...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6797&amp;PID=21695&amp;title=unable-to-get-the-handle-of-menu#21695</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 6797<br /><strong>Posted:</strong> 05 April 2007 at 2:01am<br /><br /><DIV>Hi,</DIV><DIV>CommandBars don't hold HMENU.</DIV><DIV>&nbsp;</DIV><DIV>To modify Menu/Toolbars use CXTPControls methods.</DIV><DIV>&nbsp;</DIV><DIV>f.e</DIV><DIV>pMenuBar-&gt;GetControls()-&gt;Add(..)</DIV>]]>
   </description>
   <pubDate>Thu, 05 Apr 2007 02:01:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6797&amp;PID=21695&amp;title=unable-to-get-the-handle-of-menu#21695</guid>
  </item> 
  <item>
   <title><![CDATA[Unable to get the HANDLE of Menu : Hi, I have used the follwing...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6797&amp;PID=21682&amp;title=unable-to-get-the-handle-of-menu#21682</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2903">KumarCJ</a><br /><strong>Subject:</strong> 6797<br /><strong>Posted:</strong> 04 April 2007 at 6:52am<br /><br /><P>Hi,</P><P>I have used the follwing code for Menu.</P><P>--------------------------------------------<BR><FONT color=#ff00ff>int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<BR>{<BR>&nbsp;&nbsp; //Using CXTPCommandBar --&gt;Derived from CWnd</FONT></P><P><FONT color=#ff00ff>CXTPCommandBar* pMenuBarCmdBar = pCommandBars-&gt;SetMenu(_T&nbsp;&nbsp; ("Menu Bar"), IDR_MAINFRAME);<BR></FONT></P><DIV><FONT color=#ff00ff>if(pMenuBarCmdBar == NULL)<BR>{<BR>&nbsp;&nbsp; TRACE0("Failed to create menu bar.\n");<BR>&nbsp;&nbsp; return -1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // fail to create<BR>}</FONT></DIV><DIV><FONT color=#ff00ff></FONT>&nbsp;</DIV><DIV><FONT color=#ff00ff>HMENU hMenu = GetMenu()-&gt;GetSafeHmenu();</FONT></DIV><DIV><FONT color=#ff0000><strong>//Problem:</strong> <strong>&#091;Unable to get the HANDLE of Menu&#093;</strong></FONT></DIV><P><FONT color=#ff00ff>}//End of CMainFrame::OnCreate()</FONT><BR>--------------------------------------------</P><DIV><FONT color=#ff0000>Trying to get HANDLE of Menu </FONT>in <FONT color=#ff0000>"OnCreate"</FONT> using following code,</DIV><P><FONT color=#ff0000>HMENU hMenu = GetMenu()-&gt;GetSafeHmenu();</FONT></P><P>But I am unable to get HANDLE. </P><P><strong><FONT color=#ff0000>What is the way to get HANDLE of Menu????</FONT></strong></P><P>Thanks,<BR>KumarCJ</P>]]>
   </description>
   <pubDate>Wed, 04 Apr 2007 06:52:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6797&amp;PID=21682&amp;title=unable-to-get-the-handle-of-menu#21682</guid>
  </item> 
 </channel>
</rss>