<?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 : &quot;&#079;nInitMenuPopup&quot; can not work, why?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : &quot;&#079;nInitMenuPopup&quot; can not work, why?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 10:09:26 +0000</pubDate>
  <lastBuildDate>Mon, 10 Apr 2006 04:34:43 +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=968</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[&quot;&#079;nInitMenuPopup&quot; can not work, why? : Hi,  Solution works, thanks,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12073&amp;title=oninitmenupopup-can-not-work-why#12073</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1909">BruceW</a><br /><strong>Subject:</strong> 968<br /><strong>Posted:</strong> 10 April 2006 at 4:34am<br /><br />Hi,<br><br>Solution works, thanks, though it is not quite the solution I was looking for.<br><br>The requirement I have is to be able to modify the menus depending onthe current selected view.&nbsp; Remember, the contents of the menusare dynamic, and so do not have specific IDs.<br><br>On the first call to OnInitCommandsPopup the menu gets changed.&nbsp;However on the next call I would like the menu to be according to theoriginal template (which has identifiable markers which I look for), soI can do the necessary changes again (according to the currentselection), rather than trying to figure out what changes I need toundo first.&nbsp; The key point in the second and subsequent calls isthat my original markers have been removed (they are dummy) and so itis difficult to know what to undo.<br><br>Any ideas?<br><br>Thanks,<br><br>Bruce.<br>]]>
   </description>
   <pubDate>Mon, 10 Apr 2006 04:34:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12073&amp;title=oninitmenupopup-can-not-work-why#12073</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;&#079;nInitMenuPopup&quot; can not work, why? : ohh. i see now. by OnInitMenuPopup...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12013&amp;title=oninitmenupopup-can-not-work-why#12013</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 968<br /><strong>Posted:</strong> 06 April 2006 at 10:03am<br /><br /><P>ohh. i see now.</P><P>by OnInitMenuPopup&nbsp; I mean CommandBars version of this function</P><P>&nbsp;</P><P>from Notifications sample:</P><P>&nbsp;</P><P>ON_XTP_INITCOMMANDSPOPUP()</P><P>...</P><P>void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar)<BR>{<BR>&nbsp;// get the list of commands for the popup.<BR>&nbsp;CXTPControls* pCommandList = pCommandBar-&gt;GetControls();</P><P>&nbsp;// Remove "New" menu item from the File menu.<BR>&nbsp;CXTPControl* pCommandNew = pCommandList-&gt;FindControl(<BR>&nbsp;&nbsp;xtpControlButton, ID_FILE_NEW, TRUE, FALSE);<BR>&nbsp;if (pCommandNew)<BR>&nbsp;{<BR>&nbsp;&nbsp;pCommandList-&gt;Remove(pCommandNew);<BR>&nbsp;}</P><P>&nbsp;// Rename menu item "Save" to "Save Document".<BR>&nbsp;CXTPControl* pCommandSave = pCommandList-&gt;FindControl(<BR>&nbsp;&nbsp;xtpControlButton, ID_FILE_SAVE, TRUE, FALSE);<BR>&nbsp;if (pCommandSave)<BR>&nbsp;{<BR>&nbsp;&nbsp;CWnd* pWnd = MDIGetActive();<BR>&nbsp;&nbsp;CString strCaption;<BR>&nbsp;&nbsp;if (pWnd) pWnd-&gt;GetWindowText(strCaption);</P><P>&nbsp;&nbsp;pCommandSave-&gt;SetCaption("&amp;Save " + strCaption);<BR>&nbsp;}</P><P>&nbsp;// Rename menu item "Print..." to "Print Document...".<BR>&nbsp;CXTPControl* pCommandPrint = pCommandList-&gt;FindControl(<BR>&nbsp;&nbsp;xtpControlButton, ID_FILE_PRINT, TRUE, FALSE);<BR>&nbsp;if (pCommandPrint)<BR>&nbsp;{<BR>&nbsp;&nbsp;CWnd* pWnd = MDIGetActive();<BR>&nbsp;&nbsp;CString strCaption;<BR>&nbsp;&nbsp;if (pWnd) pWnd-&gt;GetWindowText(strCaption);</P><P>&nbsp;&nbsp;pCommandPrint-&gt;SetCaption("&amp;Print " + strCaption +"...");<BR>&nbsp;}</P><P>&nbsp;// Sample of dynamic creation. Recommended to make it in OnCreateControl handler.<BR>&nbsp;CXTPControl* pControlIcons = pCommandList-&gt;FindControl(<BR>&nbsp;&nbsp;xtpControlButton, ID_VIEW_ICONS, TRUE, FALSE);<BR>&nbsp;if (pControlIcons)<BR>&nbsp;{<BR>&nbsp;&nbsp;CXTPControlPopup* pPopup =  (CXTPControlPopup*)pControlIcons-&gt;GetControls()-&gt;SetCo ntrolType(pControlIcons, xtpControlPopup);<BR>&nbsp;&nbsp;pPopup-&gt;SetFlags(xtpFlagManualUpdate);</P><P>&nbsp;&nbsp;CXTPPopupToolBar* pPopupBar = CXTPPopupToolBar::CreatePopupToolBar(GetCommandBars());<BR>&nbsp;&nbsp;pPopupBar-&gt;LoadToolBar(IDR_MAINFRAME);<BR>&nbsp;&nbsp;pPopupBar-&gt;SetWidth(200);</P><P>&nbsp;&nbsp;pPopup-&gt;SetCommandBar(pPopupBar);<BR>&nbsp;&nbsp;pPopupBar-&gt;InternalRelease();</P><P>&nbsp;}</P><P>&nbsp;</P><P>&nbsp;// Combo box's List bar.<BR>&nbsp;if (pCommandBar-&gt;GetPosition() == xtpBarListBox)<BR>&nbsp;{<BR>&nbsp;&nbsp;CXTPControlComboBox* pControl = DYNAMIC_DOWNCAST(CXTPControlComboBox, pCommandBar-&gt;GetControlPopup());<BR>&nbsp;&nbsp;ASSERT(pControl != NULL);</P><P>&nbsp;&nbsp;pControl-&gt;ResetContent();</P><P>&nbsp;&nbsp;int nID = AFX_IDM_FIRST_MDICHILD;</P><P>&nbsp;&nbsp;HWND hWndChild = ::GetDlgItem(m_hWndMDIClient, nID);<BR>&nbsp;&nbsp;while (hWndChild)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;TCHAR lpText&#091;256&#093;;<BR>&nbsp;&nbsp;&nbsp;::GetWindowText(hWndChild, lpText, 256);<BR>&nbsp;&nbsp;&nbsp;pControl-&gt;AddString(lpText);</P><P><BR>&nbsp;&nbsp;&nbsp;hWndChild = ::GetDlgItem(m_hWndMDIClient, ++nID);<BR>&nbsp;&nbsp;}</P><P>&nbsp;}<BR>}<BR></P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Thu, 06 Apr 2006 10:03:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12013&amp;title=oninitmenupopup-can-not-work-why#12013</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;&#079;nInitMenuPopup&quot; can not work, why? : No, I catch it in tne MDI parant....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12008&amp;title=oninitmenupopup-can-not-work-why#12008</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1909">BruceW</a><br /><strong>Subject:</strong> 968<br /><strong>Posted:</strong> 06 April 2006 at 9:02am<br /><br />No, I catch it in tne MDI parant.&nbsp; It used to work before subclassing off CXTPMDIFrameWnd, but now it does not.<br><br>Bruce.<br>]]>
   </description>
   <pubDate>Thu, 06 Apr 2006 09:02:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12008&amp;title=oninitmenupopup-can-not-work-why#12008</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;&#079;nInitMenuPopup&quot; can not work, why? : Hello, I guess you tring to catch...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12004&amp;title=oninitmenupopup-can-not-work-why#12004</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 968<br /><strong>Posted:</strong> 06 April 2006 at 7:45am<br /><br /><P>Hello,</P><P>I guess you tring to catch OnInitMenuPopup in MDI child? It must be catched inMDI parent.</P>]]>
   </description>
   <pubDate>Thu, 06 Apr 2006 07:45:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=12004&amp;title=oninitmenupopup-can-not-work-why#12004</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;&#079;nInitMenuPopup&quot; can not work, why? : Hi,  I have the same problem....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=11998&amp;title=oninitmenupopup-can-not-work-why#11998</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1909">BruceW</a><br /><strong>Subject:</strong> 968<br /><strong>Posted:</strong> 06 April 2006 at 4:05am<br /><br />Hi,<br><br>I have the same problem.&nbsp; My menus are dynamic and need to be modified depending on the MDI child view selected.&nbsp; <br><br>Can anbody give me a different solution.<br><br>Any help appreciated.<br><br>Thanks,<br><br>Bruce.<br>]]>
   </description>
   <pubDate>Thu, 06 Apr 2006 04:05:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=11998&amp;title=oninitmenupopup-can-not-work-why#11998</guid>
  </item> 
  <item>
   <title><![CDATA[&quot;&#079;nInitMenuPopup&quot; can not work, why? : Hello : I added &amp;#034;OnInitMenuPopup&amp;#034;...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=2554&amp;title=oninitmenupopup-can-not-work-why#2554</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=478">freehawk</a><br /><strong>Subject:</strong> 968<br /><strong>Posted:</strong> 22 July 2004 at 3:09am<br /><br /><P>Hello :</P><P>I added "OnInitMenuPopup" to my mainframe inherited from CXTPMDIFrameWnd, but after clicked the menu bar, the function was not called, Please help me, is it why?</P><P>Thank you.</P><P>-Freehawk</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Thu, 22 Jul 2004 03:09:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=968&amp;PID=2554&amp;title=oninitmenupopup-can-not-work-why#2554</guid>
  </item> 
 </channel>
</rss>