LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a function to know if a panel Handler handle something ?

In my panel handler managment, I'd like to know if a panel is already loaded or not.

Do I really have to manage my handler manually (set to -1 if discarded for example) or does CVI provides a way to know if a panel handler is "valid".

Thanks in advance...
0 Kudos
Message 1 of 4
(3,314 Views)
AFAIK there is no way to know if a particular (valid) handle points to an object still loaded. In the case of a panel you must manually set the handle to a non-valid value. You can embed both statements in a macro that discards the panel and disables the handle:
 
#define PanelDiscard(panel) { DiscardPanel (panel); panel = -1; }


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 2 of 4
(3,311 Views)
It could be a suggestion for the next version of CVI to manage handlers the way pointers are managed in C (i.e. a NULL handler if not loaded) ?!

Or there is a good reason to manage handlers this way (currently implemented in CVI) ?
0 Kudos
Message 3 of 4
(3,310 Views)
Hi Pifou, Roberto,
1) Thanks to Roberto for the macro. Easy, useful, elegant... well done Roberto... 5 stars.
2) Any Panel Function (GetPanelAttribute for example) should return an error if the panel handle is invalid. With that you can write your own PanelStillExists function.
Regards,


0 Kudos
Message 4 of 4
(3,297 Views)