<?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 : MenuBarMDIMenus  Item takes what?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : MenuBarMDIMenus  Item takes what?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 00:31:10 +0000</pubDate>
  <lastBuildDate>Wed, 05 Sep 2007 14:54:56 +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=7944</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[MenuBarMDIMenus  Item takes what? : I look forward to the fix, in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7944&amp;PID=25584&amp;title=menubarmdimenus-item-takes-what#25584</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3220">cradke</a><br /><strong>Subject:</strong> 7944<br /><strong>Posted:</strong> 05 September 2007 at 2:54pm<br /><br /><DIV>I look forward to the fix, in the mean time I&nbsp;have an acceptable&nbsp;work-around&nbsp;by getting the IEnumVARIANT interface...</DIV><DIV>&nbsp;</DIV><DIV>inline IEnumVARIANT* GetNewEnum(IDispatch* pIDispatch) <BR>{<BR>&nbsp;&nbsp;&nbsp; IUnknown* pUnk = NULL; <BR>&nbsp;&nbsp;&nbsp; _com_dispatch_method(pIDispatch, DISPID_NEWENUM, DISPATCH_PROPERTYGET, VT_UNKNOWN, (void*)&amp;pUnk, NULL);<BR>&nbsp;&nbsp;&nbsp; return CComQIPtr&lt;IEnumVARIANT&gt;(pUnk).Detach();<BR>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>XtremeCommandBars::ICommandBar* GetMenuBarById(long MenuBarId)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;CComPtr&lt;IMenuBarMDIMenus&gt; pIMDIMenus = m_spCommandBars-&gt;GetActiveMenuBar()-&gt;GetMDIMenus();<BR>&nbsp;&nbsp;&nbsp; CComPtr&lt;IEnumVARIANT&gt; pIEnum(GetNewEnum(pIMDIMenus));<BR>&nbsp;&nbsp;&nbsp; if(pIEnum)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long nCount = pIMDIMenus-&gt;GetCount();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CComVariant* pVariants = new CComVariant&#091;nCount&#093;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ULONG Fetched = 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HRESULT hr = pIEnum-&gt;Next(nCount, pVariants, &amp;Fetched);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(SUCCEEDED(hr))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(long Index = 0; Index &lt; nCount; Index++) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR></DIV>]]>
   </description>
   <pubDate>Wed, 05 Sep 2007 14:54:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7944&amp;PID=25584&amp;title=menubarmdimenus-item-takes-what#25584</guid>
  </item> 
  <item>
   <title><![CDATA[MenuBarMDIMenus  Item takes what? : Hello,  Thanks, you are right....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7944&amp;PID=25583&amp;title=menubarmdimenus-item-takes-what#25583</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 7944<br /><strong>Posted:</strong> 05 September 2007 at 2:34pm<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>Thanks, you are right. Item propety doesn't work :( Fixed for 11.2 release.</DIV>]]>
   </description>
   <pubDate>Wed, 05 Sep 2007 14:34:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7944&amp;PID=25583&amp;title=menubarmdimenus-item-takes-what#25583</guid>
  </item> 
  <item>
   <title><![CDATA[MenuBarMDIMenus  Item takes what? : What should be passed to the Item...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7944&amp;PID=25580&amp;title=menubarmdimenus-item-takes-what#25580</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3220">cradke</a><br /><strong>Subject:</strong> 7944<br /><strong>Posted:</strong> 05 September 2007 at 2:02pm<br /><br />What should be passed to the Item property of the MenuBarMDIMenus collection.&nbsp; Nothing seems to work.&nbsp; Using the CommandBars\VB\MDISample none of the following attempts work.<DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; Dim MDIMenus As MenuBarMDIMenus<BR>&nbsp;&nbsp;&nbsp; Set MDIMenus = CommandBars.ActiveMenuBar.MDIMenus<BR>&nbsp;&nbsp;&nbsp; Dim MDIMenu As MenuBarMDIMenu<BR>&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Add(100, "Document", "Document")<DIV>&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Add(101, "Image", "Image")<DIV><BR>&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Item(100)<BR>&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Item(1)<BR>&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Item(0)<BR>&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Item("Document")<BR><BR>In fact the following code never displays a message box</DIV></DIV></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; Set MDIMenu = Nothing<BR>&nbsp;&nbsp;&nbsp; On Error Resume Next<BR>&nbsp;&nbsp;&nbsp; Dim Index As Long<BR>&nbsp;&nbsp;&nbsp; For Index = 0 To 65535<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set MDIMenu = MDIMenus.Item(Index)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Not MDIMenu Is Nothing Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox MDIMenu.Caption + " " + CStr(Index)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; Next Index<BR></DIV><DIV>&nbsp;</DIV><DIV>The documentation says it should be the Id of the MDIMenu but the Id does not work.&nbsp; This in and of itself is strange since the other collections take&nbsp;the standard 1 based index.&nbsp;&nbsp; Using the Id makes it difficult to enumerate the list using the Item property since every part of the application must know in advance&nbsp;what the Id's are.</DIV><DIV>&nbsp;</DIV><DIV>Chris Radke</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 05 Sep 2007 14:02:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7944&amp;PID=25580&amp;title=menubarmdimenus-item-takes-what#25580</guid>
  </item> 
 </channel>
</rss>