10-04-2024 01:55 AM
I have a Main.vi containing an ActiveX container, a TSUI.ISequenceView.
I need to get the automation reference in an external VI, but the method on the screenshot returns only the LabVIEW control reference as ActiveX container, but not the ActiveX class.
How to get the ActiveX class?
10-04-2024 03:05 AM
IIRC, you can get the value of the control.
So, use the Value property.
However, you'll get a variant. You'd need to cast it to the type. This is probably OK, because you seem to know the type (there's an indicator of that type).
10-04-2024 03:35 AM
That was a good idea, the code is executable but it doesn't work 😞
The problem is, I have to get this reference before the Main.VI starts. Can it be a problem?
10-04-2024 06:59 AM
@Madottati wrote:
That was a good idea, the code is executable but it doesn't work 😞
The problem is, I have to get this reference before the Main.VI starts. Can it be a problem?
Yes, that is a problem. If you get the value from the main before the main set the value, you get an old or default value.
The value of an ActiveX control is (concerning the value) not different from a string value.
10-04-2024 09:48 AM
What do you need it for? Can't it wait until it's needed to get that reference? You could e.g. ask for it through a queue or event, or store it in a FGV which can flag if it's initialized or you need to wait.
10-07-2024 01:21 AM
Launching the VI and then passing the reference is working - but I still have doubts about your comment
"The value of an ActiveX control is (concerning the value) not different from a string value."
A string has a default value. But after placing an ActiveX container on the front panel I have to insert an ActiveX object in edit time. So that object is the default value, and I expect it to be valid, when the VI is not started.
10-07-2024 06:35 AM
@Madottati wrote:
Launching the VI and then passing the reference is working - but I still have doubts about your comment
"The value of an ActiveX control is (concerning the value) not different from a string value."
A string has a default value. But after placing an ActiveX container on the front panel I have to insert an ActiveX object in edit time. So that object is the default value, and I expect it to be valid, when the VI is not started.
OK, in my defense I didn't get to see all the details of your main.
I didn't know your ActiveX control was a front panel container, from your description it could also be a normal ActiveX reference control.
I don't really know when a ActiveX container becomes valid. I wouldn't think it's valid before the VI is run, but maybe it becomes valid when it isn't idle (e.g. not editable), or maybe it takes time to become valid after running. I don't know...
I try to avoid ActiveX. It never was convenient to work with and now it's dated as well...