03-06-2012 11:40 AM
Hi,
Can I close a refnum to a control right after registering the event for it or do I need to close it later when I close the 'Event Registration Refnum'?
I've attached an example VI (and a picture of it) where it is closed before and after. I get no run-time errors.
Thanks,
Albert
LV 2011
03-07-2012 12:32 PM
Hi Albert,
If you read the help file for the Register Events function you will see that when you register a particular event it will stay registered until you unregistered it or your VI stops running.
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/register_events/
This is why the Close Reference VI after you register the event does not cause any issues. The second Close Reference VI is unnecessary since you already closed the reference with the first VI.
Regards,
Josh B