LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem connecting an ImageList to an ActiveX Control

Hi,
 
I have an ActiveX control (igrid from 10Tec.com) and i want to connect an ImageList (microsoft ImageList) to it, but the property (ImageList)see in LabVIEW is just readable and i can't connect the two control together.
 
See the attach picture : In the Context menu change to write is disable !!!
 
It is not the first time that i saw this sort of problem and i am asking myself why ?.
 
My question is : Is the problem come from the Activex Control or with LabVIEW ; because in Visual Basic it is possible to connect the ImageList and the activex control together ?!!!
 
Thank you for any ideas
 
Derek
0 Kudos
Message 1 of 10
(4,960 Views)
I have remark some strange effect. I can play with some properties and method with no problem but i try to read the ImageList property i got an error message. (see attach picture).
 
What does this message mean ? Is it a problem from LabVIEW ? because in Visual Basic example every thing work fine ?!
 
Derek
0 Kudos
Message 2 of 10
(4,950 Views)
Hi Derek,

I was able to download the ActiveX control you mentioned in your post. I also experience the same behavior when using the control. Have you activated this control? I ask because the readme file prohibits the use of the unregistered version of iGrid outside of the VB IDE. This may be why we are experiencing this behavior. Please post back if you do not think that this is the case. Thanks,

Mike

Message Edited by Duffman Says: on 11-15-2006 04:38 PM

0 Kudos
Message 3 of 10
(4,929 Views)

Hi Mike,

I am actually evaluating this product and maybe the problem you say is true. i will send an email to 10Tec to have their opinion (using igrid outside VB) of this.... but i think the problem come from LabVIEW because i got exatly the same problem on an another free activex control (for making a toolbar).

 

I have ask 10Tec and they have test it. They have give this answer :

 

As you can see by iGrid.NET and iGrid ActiveX, LabVIEW does not support properly all the standard .NET and COM data types, and this concerns your last problem with the ImageList property. One of our customers already tried iGrid OCX in LabVIEW and faced this problem as well. The ImageList property has the Variant data type, and this prevents this property from being used properly in LabVIEW.

 

To solve the problem, we implemented a special separate build of iGrid in which the ImageList property was replaced with the SetImageList method (it means now you set the image list used by iGrid through the method but not the property). Attached you'll find this special build. Try to use it in LabVIEW and please let us know whether it works fine in this environment.

i send you the file in attach zip

Do you know if i got the code source of an activex control (which is create in VB), if it is possible to create a wrapper function in Visual Basic so that it is possible so connect the ImageList control to my activex control (like i connot do it directly in LabVIEW)?

Thank for any ideas

Derek

0 Kudos
Message 4 of 10
(4,916 Views)

Hi Mike,

i have test something else, to see if the problem come from LabVIEW. In LabWindows/CVI, we can convert an activex (ocx file) into an .fp library (in the cvi tools there is an utility for this). I have do it with the activex control that i can't connect an imagelist to it and the cvi function see the same thing like LabVIEW. So i don't thing that it is a LabVIEW problem.

So i think i have to ask an engineer of National Instrument if he got an idea and maybe a Visual Basic expert.

thanks

derek

0 Kudos
Message 5 of 10
(4,910 Views)
I have noticed an another strange effect. For example, if (1)  you take the igrid and create a ImageList property node,
the property can only be read (can not change to write, or it is suppose to be a write property node !!!). Now if (2) you take a microsoft activex control (the TreeView for example) and you create a ImageList property node, you can change this node to be a read or a write node (everything work fine). Make the property (ImageList) be a write property. Then disconnect the TreeView reference for the node and connect the igrid reference to the ImageList Node. The property still be a write property !!! you can then connect the microsoft ImageList activex control to the ImageList property node of the igrid and you can use it normaly. This is very strange why LabVIEW accept this no ?!!!
 
I this i really the help of an NI engineer to undestand why.
 
Derek
0 Kudos
Message 6 of 10
(4,896 Views)
Derek,

I have actually been able to observe the same behavior that you have described. It will take a little bit of effort for me to look a little deeper into why this particular control may not have access to write to the ImageList property.

I am interested to know if the method you have described for connecting the iGrid object to write to the ImageList property executes as you expect. Does this give you an error when the code is run, or does it behave as expected? Thanks,

Mike D.
National Instruments
Applications Engineer
0 Kudos
Message 7 of 10
(4,880 Views)
Hi Mike,
 
First, thank you for your help, i am very glad to know that i got an National Instruments engineer working on my problem. I really want to know that happen and have a name on that strange effect ?!!!
 
I have attach a very simple example to show that it's work (deconnect the image property for microsoft treeview for example and connect it to the igrid). I am able to place my icons in the igrid. Everything work well.
 
I want to make a remark here : This works because the property name (ImageList) on the TreeView and the Igrid is the same (Same Name). I got an another activex control from vbaccelerator (The command bar), which i want to use to make a professionnal toolbar in my project (http://www.vbaccelerator.com/home/vb/Code/Controls/Command_Bar/vbAccelerator_CommandBar_Control/arti...). This control has two image list : ToolbarImageList and MenuImageList.
 
When i try to use this property i got the same problem : i am just able to read as they suppose to be a write property (and if i try to read it, i got a compilator error from LabVIEW.... exatly the same that i got with the igrid). So, If i try to to the same thing, i have done with the treeview and the igrid, i can't because the property ToolbarImageList do not have the same name of ImageList.
 
My question is :
 
(1) can i have a solution for that problem in LabVIEW.
 
(if not) : (2) do i have to create a new function, a wrapper function in Visual Basic that will make this connection  (ToolbarImageList of the Command Bar) possible in LabVIEW (this is mean that i got the source code of the activex control like this control in a open source). Now i will have to contact a VB expert to have information on how to do this.
 
(3) Maybe create a new (activex) dll in VB, with only one function that will got parameters, one will be the reference of the control you want to connect an ImageList and the second parameter will be  the reference of the ImageList Control (microsoft imagel list for example). This function will make the a "in house" connection of the two controls ?!!! (i don't know it is just an idea ? !!!)
 
I am waiting of any information that you can give me because i really want to make this toolbar working like i am able to make the igrid work in my project.
 
Thank you very much for your help
 
Derek
 
 
0 Kudos
Message 8 of 10
(4,862 Views)
Derek,

I was looking into why those ActiveX controls might not contain a full list of properties. What it comes down to is the format of the declarations in the configuration files of the ActiveX controls. LabVIEW looks very specifically at these files and expects to find perfect syntax. If they were not constructed in exactly the correct manner, then the property and method list might be incomplete. These same controls could work in VB because VB interprets the configuration a lot more loosely than in LabVIEW.

Unfortunately there is no way to relax the requirements that LabVIEW uses to interpret the property and method list of an AcitveX object. If you want the control to work seamlessly in LabVIEW, the creators of the control must guarantee that the strict syntax is adhered to.

From what I have learned, I believe it would be possible for you to write a wrapper in VB that would map the property correctly to your ActiveX control. Unfortunately I cannot help you with this process, but I do believe that it should be possible. Another valid solution would be to create a new VB dll that could be called from LabVIEW that would have the same functionality as the ActiveX object. You can then call this dll from LabVIEW.

I hope this information has been useful for you. Good luck with the implementation of these controls in LabVIEW!

Mike D.
National Instruments
Applications Engineer
0 Kudos
Message 9 of 10
(4,843 Views)
Thank you very much Mike,
 
Now i know exactly where the problem come from. I will go in your direction : create a VB wrapper or an another dll.
 
Derek
0 Kudos
Message 10 of 10
(4,830 Views)