LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I access an ActiveX control's interface when have its generic control refnum in hand?

I don't know of a way to do that in LabVIEW, but perhaps someone else may know. If you were using .NET then you could use reflection to accomplish the task.
0 Kudos
Message 11 of 31
(1,415 Views)
There must be a way of getting the ActiveX refnum and cast it.  Will explore it a bit more.
0 Kudos
Message 12 of 31
(1,404 Views)

Hey all,

This is an interesting discussion that we have going on here.  What kind of information is in your control?  I think that might help to track down how this might be done.

Adam H
National Instruments
Applications Engineer
0 Kudos
Message 13 of 31
(1,384 Views)

Its quite irrelevant actually. I just want to be able to interrogate an OCX to find the appropriate interface.

 

Sorry, gotta go. Thanks

 

 

Adrian

0 Kudos
Message 14 of 31
(1,379 Views)

Well, I've looked at the flattened string of the refnums as retreived by the Controls[] and by passing a refnum of the AX control directly.  Looks like the actual refnum with type attached contains GUIDs where the one received from the VI's FP does not.  There is a common 0x4070 value as the second element that may indicate that the control is a ActiveX container, but other than that, I see no way of mapping. 😞  That sucks!

 

Attached is the information that I received.  Looks like I'm giving up. 😞

 

 

0 Kudos
Message 15 of 31
(1,365 Views)
In case anyone is interested, just tried a "to more specific class" without success.  It actually had less data when flattened. 😞
Message Edited by Been bitten by LabVIEW on 11-21-2008 11:21 AM
0 Kudos
Message 16 of 31
(1,350 Views)
If you were able to get the dispatch GUID then you should be able to figure out the class of the ActiveX control based on the GUIDs in the registry. You won't be able to perform any casting because, as I indicated, I don't believe this operation is even possible, even outside of LabVIEW. I may be wrong on this last point, though - I just don't know.
0 Kudos
Message 17 of 31
(1,332 Views)

The GUIDs are only on the wire that is attached to the ActiveX refnum DIRECTLY.  Thus it contains the type information including the GUIDs.

 

I want to convert the control refnum that is pointing at the ActiveX container to give me the same type of connector.

 

Here is the block diagram.
Message Edited by Been bitten by LabVIEW on 11-21-2008 04:10 PM
0 Kudos
Message 18 of 31
(1,326 Views)

As you've found out, when you get the reference via the Controls[] property all you get is a generic reference. Even if you cast it to be an ActiveXContainer all you get is a generic ActiveXContainer. You can cast it to a specific ActiveX control by wiring a (direct) reference to an ActiveX control, but you have no way of knowing if the cast is correct since the casting is likely to give no error.

 

I don't know if it's possible to do what you want with ActiveX controls. Perhaps Adam may be able to dig something up.

0 Kudos
Message 19 of 31
(1,306 Views)
Hi All, I have been messing with it and keep running into the same problems everyone else is.  I have not given up hope yet.  I will keep everyone updated with anything I find. 
Adam H
National Instruments
Applications Engineer
0 Kudos
Message 20 of 31
(1,277 Views)