LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Name of Submenu in CVI

How can I get the name of a Submenu of a menubar? I'm using the function "GetMenuBarAttribute" with the Attribute "ATTR_MENU_NAME", but this will only let me know the Name of the Menu but not of the Submenus.
0 Kudos
Message 1 of 9
(3,833 Views)
Hi Andy,

what do you want to do with the name of the Submenu?
Can't you simply use the Callbackfunction? Or do you want to modify your Menu during runtime?

regards,

Peter Weber
NI Germany
0 Kudos
Message 2 of 9
(3,833 Views)
Hallo Peter,
Ich erzeuge dynamisch ein Menu mit Submenus. Die Submenus enthalten Namen von Libraries, die ich beim anwählen laden will. Um die entsprechende Library zu laden brauche ich den Namen der Library vom Submenu.
0 Kudos
Message 3 of 9
(3,833 Views)
Hallo Andy,

Sie können die Funktion "GetMenuBarAttribute" verwenden, um die SubMenuID zu bekommen.
Mit einem erneuten Aufruf von "GetrMenuBarAttribute" müssten Sie dann unter Angabe der SubMenuID den Menunamen abfragen können. Dieser Menuname ist der Name vom SubMenu.

Gruß

Peter Weber
NI Germany
0 Kudos
Message 4 of 9
(3,833 Views)
Hallo Peter,

Ich hatte wohl das falsche Attribut erwischt. Mit ATTR_ITEM_NAME funktioniert es, hatte wohl ATTR_MENU_NAME erwischt.

Vielen Dank
0 Kudos
Message 5 of 9
(3,833 Views)
Hi,
It's very nice that both of you can speak German. Unfortunately, I don't, and I was really interested to read your answer...
0 Kudos
Message 6 of 9
(3,833 Views)
Ok, the thing was that I took the wrong attribute for the GetMenuBarAttribute Function. With ATTR_ITEM_NAME you really get the name of the Submenu Item and with ATTR_MENU_NAME you get the name of the Menu. Hope this will help

Regards, Andy
0 Kudos
Message 7 of 9
(3,833 Views)
Hi Rafi,

sorry for that, I have not thought about other readers.
Here is a small summary:

Andy wants to get the Submenu-names in order to load appropriate lybraries with the same name.

So I suggested to use the "GetMenuBarAttribute" to get the SubmenuID; and with this ID he could poll the Submenu-name using the "GetMenuBarAttribute" again.

But in the meantime he has already solved the problem. In fact he only took the wrong Attribute ("ATTR_MENU_NAME"), where the right one would be "ATTR_ITEM_NAME".

I hope I could help you with this...

Best regards

Peter Weber
NI Germany
0 Kudos
Message 8 of 9
(3,833 Views)
Thanks
Rafi
0 Kudos
Message 9 of 9
(3,833 Views)