LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a reference to an ActiveX object prior to object's control's owner VI execution

Hey there, the problem is rather simple:

I have an ActiveX container box that is located in a subVI of a main program. That subVI should run in dialog-mode, allowing me to just view the contained object (CWGraph3D) and close the dialog. The actual plotting (number of plots, styles and values) is done in another subVI of main that can run before or after the displaying VI. The actual problem is:

Since I need to run the plotting VI prior to running the display VI, I need the CWGraph3D reference of that object in my grasp before ever running the VI that holds the ActiveX Container. But I hardly understand how that could be done. If I open a VI reference, the best thing I can do is opening a control refnum for the ActiveX container, but not for the object contained in it. The value property for the ActiveX container class is a variant, and, on quick inspection, showed to return Not A Refnum after converting the variant data to CWGraph3D refnum type.

Is what I'm trying to do even possible or should I try some entirely different solution (run the display VI prior to everything, for example, and make it return the object refnum to work with later on)?
0 Kudos
Message 1 of 2
(2,547 Views)
You have an alternative, that might be easier.


When you call the subVI, at the moment it opens immeadiatelly, before the data is initialized. Probably because the VI is set to modal, and open when run.


You don't need to do that. In the VI (configured as normal VI), use a methon Front Panel.Open to open the vi's front panel when the data is configured. Now, the VI will show when the initialization is completed. You'll have to close the front panel when you're done with the same method.


Once you have that working, you can even go to the next step.


You have the code to initialize the AX control. And you have the code to show and hide the UI. So you can put both parts inside a case structure, and with a boolean control you can pass to the subvi what you would like it to do. So you wire a true to the "init", call the VI, and it initializes the control but doesn't show it's UI. Then you call it again with the boolean set to false. The control won't change it's data, but the UI will show. It seems complicated, but it's quite simple. Try it with a normal string control before you try it with the AX control.


Regards,


Wiebe.
0 Kudos
Message 2 of 2
(2,528 Views)