10-10-2016 01:08 AM - edited 10-10-2016 01:08 AM
Hello,
when I close my program (QUIT Button LabWindows) I thought with the line "DiscardPanel (MainPanelHandle); " the program gets closed and the application does not run anymore. But now I have seen that after this call every button I have in my application gets called and closed with the return 0. Can somebody explain why I have this and if this is normal? Every button of my application works with the event "EVENT_COMMIT".
Hope someone can help me.
Best regards
Solved! Go to Solution.
10-10-2016 01:39 AM - edited 10-10-2016 01:39 AM
When you discard a panel, every control (not only buttons) receives a EVENT_DISCARD event: this is intended as a means for you to handle a panel discard in case it is necessary to handle some special action. For example, when receiving a discard event a button that controls an external device could issue a stop command to that device.
Your controls should not receive any EVENT_COMMIT event: callbacks that handle only that event should get called and exit immediately without doing anything: you can verify this by placing a breakpoint in one callback and step-trace its behaviour (F8 after break issues instructions one-by-one so that you can monitor exactly what's happening).