LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling ActiveX dll in Labview

Solved!
Go to solution

Hello,

 

I am a new starter in C#.net.  I have a ActiveX control dll (NI vision control -> CWIMAQ). I need to call the dll functions in Labview. I searched for the articles about this topic. everybody talking about Single thread and register the dll.  I have no idea about these things. Any body can give me a hand. How it works? 

 

Thanks for any info

 

best regards.

0 Kudos
Message 1 of 7
(6,656 Views)
Solution
Accepted by topic author newuser12342

To use an ActiveX control in LabVIEW you place an ActiveX container on the front panel and browse for the control to put it in. Then use property nodes and/or invoke nodes from the ActiveX palette to set properties and call methods.

 

To register a DLL open a command prompt, navigate to the folder where your ActiveX control is, normally the system32 folder of Windows, and type

regsvr32 <name of dll file>.

 

In LabVIEW use Help >> Find Examples... and type in the Search tab ActiveX.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 7
(6,639 Views)

Thanks for the info.

 

I think i mislead the qustion. I am sorry.

 

I created a C# .net dll with a Form and a ShowForm() function to display the Form. I can call the ShowForm() function from Labview and display the Form without problem.

 

Now I add a NI Vision control (CWIMAQ) to the Form, rebuild it. It doesnt work any more. The error msg was: "he ActiveX-Control adbf7240-2b8d-11d1-b5c5-00a024d63828 cannot instantiate, the current Thread is not Singlethread-Apartment"

 

Any one can help with this error?

 

thanks and best regards

0 Kudos
Message 3 of 7
(6,622 Views)
Since this is a C# problem you may repost it in the Measurement for .NET Languages subforum.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 7
(6,600 Views)
Thanks.
0 Kudos
Message 5 of 7
(6,588 Views)

Hello,

I had a problem using activeX dll.

I made a dll ActiveX using vb6, it works properly with my development computer with a Labview test program.

I copy this dll, i used regsrv32 and it answered "register successfully". I try my test program (i verified if my refnum are linked to this dll): it doesn't work.

I unregistred and registred again.

Still doesn't work.

 

Each time, i try the software twice before unregistering and registering this dll activeX

 

It occurs these two errors

 

-2147221164
Class not registred
 in test.vi

-2147417851
The server thrown an exception
 in test.vi

Can you help me please?

0 Kudos
Message 6 of 7
(6,417 Views)
of course, to use the dll with the second computer i had firstly install VB6 runtime
0 Kudos
Message 7 of 7
(6,416 Views)