Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 4 out of 5     Rate this Document

Run-Time Error When Calling InstallPopup on a Child Panel in LabWindows/CVI

Primary Software: LabWindows/CVI Development Systems>>Full Development System
Primary Software Version: 8.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
Why do I receive a NON-FATAL RUN-TIME ERROR when calling InstallPopupon a child panel in LabWindows/CVI (shown in attached "ErrorPopup.jpg" snapshot)?

Solution:
When you install a child panel as a popup, it is temporarily promoted to the status of a top level panel while still living in the list of child panels for its parent (even though it is momentarily not a child panel). As soon as you call RemovePopup, it is a normal child panel again.

Normally, this behavior goes unnoticed unless you are using the Tooltip functionality from the Toolbox instrument. This activates a timer which, among other things, iterates over the child panels of the panel which hosts the tooltip control. This code relies on child panels acting like child panels. Once you call InstallPopup on a child panel, it will no longer act like a child panel until you call RemovePopup. The result is an error in the tooltip code indicating that the popup panel is not a child panel, which is reported through RunUserInterface (because the error was created in response to a UI event, in this case a timer tick event).

The best workaround is to load the child panel as a top-level panel instead. To do this, pass 0 for the parentPanelHandle parameter of the LoadPanel function.

Related Links:

Attachments:


ErrorPopup.JPG - ErrorPopup.JPG



Report Date: 02/19/2007
Last Updated: 03/08/2007
Document ID: 46IJE6SN

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit