LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Window handle of a child panel and ExecutionView of TestStand

 I create a multiple window user interface with CVI. Although it can run, the Execution view (ActiveX control of TestStand) doesn't display
anything while execution. In my user interface, there is an applicaiton manager resident in Parent form, and every child forms has
itsown Exection view and Manager.
Referred to the C# sample
in the function: 
private void DisplayExecution(Execution execution)
  {
    ....
   if (executionForm == null) // execution is not in a form, make a new form
   {
    executionForm = new ExecutionForm(this, this.axApplicationMgr, execution);
    this.mChildFormsKeyedByViewMgr.Add(executionForm.GetViewMgr().GetOcx(), executionForm);
    SetNewChildFormLocation(executionForm);
   }
   ...
 I guess the execution form "hook" the exectuion view manager via Add(), so the exectuion view can be updated properly.
And according to reference manual of teststand, it mentions that "The application sets the ExecutionViewMgr.UserData property to
attach a handle, reference, or pointer that represents the window." But when I try to utilize this method, I got 2 problems:
 
1. How to get a window handle of a CVI Child panel? As execution view are resident in child panels, so I may need the window handle of
 individual child panels. GetPanelAttribute(,ATTR_SYSTEM_WINDOW_HANDLE,) seem won't work as the handle of child panel is always 0. 
 
2. Even the window hanlde is gotten, how can I convert it to a VARIANT Type? According to the function panle of
TSUI_ExecutionViewMgrSetUserData (, NULL, ), the last parameter is a "VARIANT".
Any comments or instructions for my assumption?
 
Thank you for your help.
0 Kudos
Message 1 of 3
(3,350 Views)
Good afternoon,

I'm not a TS expert, so I don't really have the answer for (2) for you, but as far as your fist question goes it will not be possible to get the windows handle for the child panel.  This may render question (2) useless, but some supporting documentation for you follows:

http://digital.ni.com/public.nsf/websearch/987432B1A46DE25786256FF1006E16B4?OpenDocument

Hopefully this addresses the question from the CVI side of things, perhaps a TS expert can comment on question 2 or the TS interface in general.
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 3
(3,330 Views)
You can convert values to Variants using the CVI ActiveX function panel set.  There is an entire set of functions regarding Variants, including converting Variant types to and from ANSI C types.  Accordingly, the TSUI_ExecutionViewMgrSetUserData will accept the Variant types defined by CVI.  Because handles are simply integers, you should use the CA_VariantSetInt() function.  The full library path is Library -> ActiveX Library -> Variant Related Functions -> Assigning Values to Variants -> Variant Set Int.

Regards,

Tyler T
Message 3 of 3
(3,323 Views)