LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

when i add menu bar in my user interface gives me error that this handle is not a panel handle(return value -42)

i have 3 panels in my application and parent panel is displayed first then i display other two panels which come to the front then on entering correct password i discard the child panel and then you can see parent panel , but there is an issue when i add menu to my parent panel i dont know whats wrong when i add menu bar in my user interface (parent panel)  gives me error that this handle is not a panel handle(return value -42) for a child panel. when i dont open and display child panel then its fine , and even without menu added to my parent panel all my panels and my application works perfactly

0 Kudos
Message 1 of 7
(4,514 Views)

It is evidently a problem on some variable not set to correct value in some moment. It's difficult to understand where and why without some code to examine: can you make up a small sample program that mimics your app behaviour and exposes the problem? It's also possible that while making this sample you find the problem yourself: sometimes making the applications simpler clarifies the sistuation.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(4,512 Views)

please guide me with some menu bar tutorial  and sample code/project will be a great help , thanks in advance

0 Kudos
Message 3 of 7
(4,439 Views)

It's not that there is some special trick in manipulating menu bars, I suppose the problem lies inside your specific code that is not correctly handling some variable or handle. Besides it, it is not clear whether you are adding menu bars dynamically at run time and receive an error in doing so, or you are getting the error inside a menu item callback.

Rather then having me to build up some esample that may be different from what you actually need, it is better that you post your code for us to guide you through the correct solution.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 7
(4,424 Views)

are there any example codes which  provide understanding of how to add menu bar to my project

0 Kudos
Message 5 of 7
(4,344 Views)

Hello smartprogrammer,

some more informations are needed in order to properlu help you in this situation:

 

- Are you adding menus dynamically at runtime or in the UIR editor? If dynamically: how are you loading the menu bar?

- Are you dynamically tailoring the menu bar at runtime (adding or deleting menu items, dimming / undimming some of them or checking / unchecking)?

- Can you post the code where you are getting the error, documenting variables and scope (local to the function, global to the source file, global to the project)?

 

You can look at uirview.prj example that ships with CVI for an example of LoadMenuBar (the exampl eis in <CVI samples>\userint folder): in that project, the menu bar is shown as a context menu when you right-click on a tree element (see DeferredMenuCB callback).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 7
(4,332 Views)

Other useful questions:

 

- Is the menubar to be loaded already developed in the UIR editor or do you want to create it at runtime?

- Are you loading it directly into a panel or do you plan to attach to a panel after it has been loaded? Or do you want to launch it with RunPopupMenu?

- Is it already loaded on other panels?

- Which relase of CVI are you using?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 7 of 7
(4,314 Views)