LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add Type Library Interface

Hi,
 
I have a type library that I created in C++.  In this, I can create ATL object and create interfaces from templates that I have already written.  In C++, its quite easy but I cant seem to figure out how to do this in LabVIEW.  If anybody can help me, this would be great.
thanks
 
0 Kudos
Message 1 of 10
(4,356 Views)
When you create a VI, you can do a save as and select .vit as the extension. The .vit extension stands for VI template. You can also save controls as templates by using the .ctt extension. When you select "New" from the file menu, you'll have an option to select VI from Template.
0 Kudos
Message 2 of 10
(4,353 Views)

I'm sorry, my question was a bit to vague.  My template is in an actual Type Library file (tlb) that I wrote in C++.  I can access methods and properties with an automation reference, but I can't seem to find how to access an interface.  In C++, you add a ATL object (Active Template Library... I think), and then you can access different interfaces.  Here's a link on how to do this in C++:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vctskImplementingInterf...

I would like to know how to do this in LabVIEW if its possible.

Thanks

Message Edited by NahoY on 12-21-2005 09:16 AM

0 Kudos
Message 3 of 10
(4,348 Views)
Sorry for the misunderstanding. My experience with ActiveX stops with accessing properties and methods.
0 Kudos
Message 4 of 10
(4,340 Views)
The node you're looking for is "Variant to Data". Just wire in the ActiveX refnum into the input (it will auto-adapt, no need to make it a variant) and use an ActiveX refnum constant to specify the "type" you want to convert to. It then issues the QueryInterface internally to return that interface.
Message 5 of 10
(4,327 Views)
In what data type does it return the interface??
0 Kudos
Message 6 of 10
(4,321 Views)
I'm afraid I don't understand your question. If you have a LV refnum to an interface on your class (IFoo), then to get a different interface (IBar), just call the Variant to Data. All three terminals are going to be refnums. IFoo refnum going in, IBar refnum constant going in the top and the IBar refnum instance coming out.
 
Did that make any sense?
0 Kudos
Message 7 of 10
(4,311 Views)
Nope! hehe
 
Can you forward me an example of what you mean?
 
Thanks
 
0 Kudos
Message 8 of 10
(4,305 Views)
Here is what I mean.
 
However, looking over your post again, I just want to make sure...this is how you access the various interfaces ALREADY implemented by the COM/ActiveX object. You can't implement the interface inside LV...
 
 
0 Kudos
Message 9 of 10
(4,298 Views)

Thanks for the hel Lycangeek,

but I was looking for a way to implement the interface.  Too bad its not possible in LabVIEW, I think its the first time I run into that kind of problem.

Thanks again for the help.

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