<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Rif.: DiscardMenuItem fail error -11 in LabWindows/CVI</title>
    <link>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114919#M69964</link>
    <description>&lt;P&gt;I was using the wrong command.&amp;nbsp; I see that my probem was that I thought the menu bar was the menu and didn't realize that each primary entry in the menu bar was a menu.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, I was getting error -11 not -1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2015 13:20:19 GMT</pubDate>
    <dc:creator>mjl</dc:creator>
    <dc:date>2015-04-06T13:20:19Z</dc:date>
    <item>
      <title>DiscardMenuItem fail error -11</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114414#M69942</link>
      <description>&lt;P&gt;I have a menu that I created in the UI editor and placed on a panel.&amp;nbsp; I want to programatically remove menu items.&amp;nbsp; I get error -11 &lt;SPAN class="Monospace"&gt;UIEInvalidMenuItemId&lt;/SPAN&gt;.&amp;nbsp; I even tried removing the menu from the panel and loading the menu separately and I still get the error.&amp;nbsp; When that failed I triedI to set the dimmed atrribute.&amp;nbsp; That worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iMenu = LoadMenuBar(iMainPnl, "140613.uir", MBR_BADGE);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iTmp = DiscardMenuItem(iMenu, MBR_BADGE_MOTOR);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;iTmp = SetMenuBarAttribute(iMenu, MBR_BADGE_MOTOR, ATTR_DIMMED, TRUE);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CVI 2012 SP1&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2015 18:40:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114414#M69942</guid>
      <dc:creator>mjl</dc:creator>
      <dc:date>2015-04-03T18:40:26Z</dc:date>
    </item>
    <item>
      <title>Rif.: DiscardMenuItem fail error -11</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114549#M69946</link>
      <description>&lt;P&gt;This behavior looks correct to me: you can delete menu items or submenus, not menus, that is you need to pass&amp;nbsp;at least a third-level id to the function (menuBarID_menuID_menuItemID or &lt;SPAN&gt;menuBarID_menuID_subMenuID). You can dim a whole menu, instead: every element from the menu that shows on the menu bar up to the last item is dimmed, including all submenus if they exist; other menus in the menu bar are left unchanged).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In your scenario, I suppose MBR is the menu bar ID and MBR_BADGR a menu ID. Menu items should be in the form MBR_BADGR_menuItemID.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By the way, error -1 means&amp;nbsp;&lt;/SPAN&gt;"the id passed was not a valid menu item id": you can obtain this descriptive string by calling GetGeneralErrorString passing the error number to it.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 08:03:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114549#M69946</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2015-04-04T08:03:04Z</dc:date>
    </item>
    <item>
      <title>Rif.: DiscardMenuItem fail error -11</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114561#M69947</link>
      <description>&lt;P&gt;Forgot to say that you can use &lt;A href="http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cvidiscardmenu/" target="_blank"&gt;DiscardMenu&lt;/A&gt;&amp;nbsp;to delete a menu from the menu bar.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 12:01:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114561#M69947</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2015-04-04T12:01:48Z</dc:date>
    </item>
    <item>
      <title>Rif.: DiscardMenuItem fail error -11</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114919#M69964</link>
      <description>&lt;P&gt;I was using the wrong command.&amp;nbsp; I see that my probem was that I thought the menu bar was the menu and didn't realize that each primary entry in the menu bar was a menu.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, I was getting error -11 not -1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 13:20:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/DiscardMenuItem-fail-error-11/m-p/3114919#M69964</guid>
      <dc:creator>mjl</dc:creator>
      <dc:date>2015-04-06T13:20:19Z</dc:date>
    </item>
  </channel>
</rss>

