LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When using a dll, why do I see an Object's property as a method?

I have a dll made in Visual basic and I want to call it in LV. The dll has only one creatable object, and one of its methods calls another non-creatable object.
For this non-creatable object I'm expecting two properties (I already check in Visual Basic). But instead of having two properties, appears only one. The missing property appears as a method of the same object.
I guess this is why the program is generating me an error (Member not found).
I would like to know if this is a posible LabView problem when interpreting this dll?? or how can a fix this problem in order to work with this dll within LV
0 Kudos
Message 1 of 3
(3,114 Views)
First let's make sure that you're calling it correctly. Since you built the DLL in Visual Basic, it is an ActiveX DLL. How are you calling it? Are you using the Call Library Node? If so, you can not actually do that. You want to treat it as an OLE object and call it with the ActiveX interface in LabVIEW using an automation refnum control?

Right-click on the refnum control, choose Select ActiveX Class » Browse..., and browse to your newly registered ActiveX object (your Visual Basic DLL applied to regsvr32.exe). You should be able to view all methods and properties of the DLL. Here is an e
xample program from NI's website which demonstrates how to do this.
J.R. Allen
0 Kudos
Message 2 of 3
(3,114 Views)
I'm calling it using the call library node. And this is how the example show me to call the dll.
Could you explain me what do you mean by treat it as an OLE object?.

The steps I'm following are:

1) Paste a refnum Control and select the activeX class I need (let's call it Comm, which by the way is the only creatable object).

2) Open the aplication using the Automation open funtion.

3) Use the invoke node to select a method called: ceateLanguaje, which returns me a refnum, which I will call "English"
For the Comm object, I'm able to use its methods and they don't return me an error.

4) But when I want to invoke a new node using the class "English" an error occurred, for any method. And here is where one of the methods should be a class.


I attached a simple piece of code, to give you a better idea.

Thank you!!!
0 Kudos
Message 3 of 3
(3,114 Views)