LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Discard Panel question

Solved!
Go to solution

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

0 Kudos
Message 1 of 2
(3,059 Views)
Solution
Accepted by topic author Fasching_K

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).



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 2
(3,047 Views)