11-19-2008 09:32 AM - edited 11-19-2008 09:38 AM
Hi all,
I am scanning a front panel for controls. In that front panel, there is an active x control (may have a few). I want to interrogate that control for ones that have a compatible interface and access that interface. Going to a more specific class doesn't work, and using a cast just causes the code to go nowhere when it enters a property or invoke node. Is there a way to do this?
I'm using LV 7.0 under Win XP.
Thanks,
Adrian
11-19-2008 09:52 AM - edited 11-19-2008 09:52 AM
Been bitten by LabVIEW wrote:Hi all,
I am scanning a front panel for controls. In that front panel, there is an active x control (may have a few). I want to interrogate that control for ones that have a compatible interface and access that interface. Going to a more specific class doesn't work, and using a cast just causes the code to go nowhere when it enters a property or invoke node. Is there a way to do this?
I'm using LV 7.0 under Win XP.
Thanks,
Adrian
Message Edited by Been bitten by LabVIEW on 11-19-2008 09:38 AM
Just a thought...
Would check ing the error code returned by the "To more Specific" help with a "trial and error approach"? There is an example of this approach used in my Nugget on using Control references.
Just trying to help,
Ben
11-19-2008 10:00 AM
11-19-2008 10:05 AM
11-19-2008 10:14 AM - edited 11-19-2008 10:17 AM
Yeah, you've basicly have done what I've done already, except for regular LV controls, I use the class name instead of using the "To More Specific Class" node to try and test. I beleive that it (using "To More Specific Class" to test) was slowing down the process and causing the mouse cursor to flash.
And as I've stated in my previous post, this doesn't work for ActiveX controls. Thanks anyway.
Any other suggestions?
Adrian
11-19-2008 10:16 AM
Please state what you mean and what the difference is between "ActiveX containers" and "ActiveX reference control".
Thanks
11-19-2008 10:18 AM
Been bitten by LabVIEW wrote:Yeah, you've basicly have done what I've done already, except for regular LV controls, I use the class name instead of using the "To More Specific Class" node to try and test. I beleive that it was slowing down the process and causing the mouse cursor to flash.
And as I've stated in my previous post, this doesn't work for ActiveX controls. Thanks anyway.
Any other suggestions?
Adrian
Does that indicate you have a method that works but you are un-happy with the flashing? If so you could scan the FP once when it starts and cahce your finding for use latter.
Take care,
Ben
11-19-2008 10:22 AM
Been bitten by LabVIEW wrote:Please state what you mean and what the difference is between "ActiveX containers" and "ActiveX reference control".
The ActiveX container is a container that houses an ActiveX control on the front panel. The ActiveX reference control is the Automation refnum control in which you use the Automation Open function to create the ActiveX class.
11-19-2008 10:38 AM
I wrote a bunch of code to scan all the controls on a FP and if they were found within the FP rect, to capture the text. It did this by scanning the FP for all the controls grab all of the text and font info from each control depending on type of control it is, and writing all of this data to a file. It works fine, except for ActiveX controls. I want the same scanning routine to work for them if possible by exposing a particular property that would send a 2D array of property name/value pairs which my code will be able to interpret.
This requires that I am able to interrogate the type of ActiveX control and access its interface given the control refnum.
This should be a simple thing, but I've found that simple is not necessarily synonymous to LV :(, at least in LV 7.0, maybe it gets better in LV 8. Don't get me wrong, LV is great for some things, but I feel that is a bit crippled compared to some other languages and libraries I've used in the past.
Adrian
11-19-2008 10:41 AM - edited 11-19-2008 10:42 AM
Cool thing to know. I'll have to look in to Automation refnum controls later. 🙂 I'm using the ActiveX container that houses the ActiveX control on the front panel.
I'm guessing that I have to dereference the ActiveX container to get at the control somehow?