01-08-2019 02:59 PM
My application has a custom runtime menu, which has an associated *.rtm file. The application is built into an exe with debugging enabled. The exe runs as expected when not using the debugger, but when debugging the application (using menu item Operate->Debug Application or Shared Library... from the LabVIEW project), the custom menu is replaced with the default menu. This is a problem because much of the application's functionality is accessed through the custom menu. I have tried setting the menu when the application is running using the RT Menu Path property, but this does not work when debugging (the menu is still the default menu). I have worked around this by building the menu at runtime using the LabVIEW menu functions such as Insert Menu Items, but this can be pretty painful for large menus. Is there an easier way to have my custom menu still work when debugging an executable. It would be nice to still be able to use the menu editor to create my custom menu.
01-08-2019 03:12 PM
My application has a custom runtime menu, which has an associated *.rtm file. The application is built into an exe with debugging enabled. The exe runs as expected when not using the debugger, but when debugging the application (using menu item Operate->Debug Application or Shared Library... from the LabVIEW project), the custom menu is replaced with the default menu. This is a problem because much of the application's functionality is accessed through the custom menu. I have tried setting the menu when the application is running using the RT Menu Path property, but this does not work when debugging (the menu is still the default menu). I have worked around this by building the menu at runtime using the LabVIEW menu functions such as Insert Menu Items, but this can be pretty painful for large menus. Is there an easier way to have my custom menu still work when debugging an executable. It would be nice to still be able to use the menu editor to create my custom menu.
01-10-2019 10:17 AM
cbfsystems,
I was unable to reproduce your issue on my computer. Could you try and recreate a sample project that only has one or two items and see if it behaves similarly? If you haven't already forced recompile, I would suggest doing that as well.
01-10-2019 11:22 AM
A small project demonstrating the issue is attached to the second post above. An executable is included. If you run it first, without debugging, you will see the expected menu behaviour (the menu is changed while it runs). When I run it using the debugger, the menu is just the default menu. I tried forcing a recompile as suggested, but that did not change the behaviour.
01-11-2019 10:20 AM
Hello cbfsystems,
I attempted to replicate this issue using the provided zip file as well as on an example project I built locally and was unable to see this issue. What are the steps that you are using to create the debuggable executable?
-Michael
01-11-2019 11:30 AM
I create the debuggable executable using the "Custom menu" build specification in the project.
If I run the executable without using the debugger (double click on "Custom menu.exe then click the run button in the application window) the menu shows "Another menu" for one second, then changes to "My menu" for one second, then changes back to "Another menu" for two more seconds, then the application stops.
To run the application using the debugger, I use the following steps:
In this case the application menu is the default menu for the four seconds that the application runs.
Is there anything else that you are wanting to know about how I created the debuggable executable or what I was doing when I observed the lack of custom menu?
01-14-2019 10:17 AM
Cbfsystems,
Have you tried running the application and then connecting it to the debugger?
Michael
01-14-2019 02:03 PM
@MichaelFay wrote:
Cbfsystems,
Have you tried running the application and then connecting it to the debugger?
Michael
I tried running the application before connecting to the debugger and that almost does what I want. It appears that the menu used in the remote debugging session is the menu that is shown at the time the remote debugger is connected. If the application is not running when the debugger is connected, then the menu is the default menu. If the application is running and is showing a custom menu when the debugger is connected, then this custom menu will be shown. So far so good. Unfortunately, the runtime menu cannot be changed in a simple way by using the RT Menu Path node after the debugger is started. Changing the menu is sometimes needed such as in a device configuration application that we have written. In this application, the menu options change depending on the firmware version of the device that is connected. The menu can be changed when the debugger is running by using the LabVIEW menu functions such as Insert Menu Items, but this is a bit painful.
I am attaching another simple project that demonstrates the menu behaviour. The menu can be changed at runtime using the radio buttons. Clicking on the menu item will display a dialog box with the appropriate message.