Oberon Community Platform Forum
November 23, 2017, 09:54:14 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ActiveX controls usage  (Read 3487 times)
fnecati
Jr. Member
**
Posts: 60


« on: May 27, 2008, 09:54:03 AM »


I need to use NationalInstruments.CWIMAQControls.AxCWIMAQ control (derived from System.Windows.Froms.AxHost ) for the acquisition of images from the camera.

Is it possible use such ActiveX controls  in Zonnon without using MS Visual Studio?

If possible, could you provide a simple example.


**********
import

 NationalInstruments.CWIMAQControls.AxCWIMAQ as AxCWIMAQ;


var cw: AxCWIMAQ;

cw := new AxCWIMAQ();


it compiles but when I run the program
it gives following runtime error:

Unhandled Exception: System.Threading.ThreadStateException: ActiveX control '865
5ee93-d864-11d0-b521-00a024d63828' cannot be instantiated because the current th
read is not in a single-threaded apartment.
   at System.Windows.Forms.AxHost..ctor(String clsid, Int32 flags)
   at System.Windows.Forms.AxHost..ctor(String clsid)
   at NationalInstruments.CWIMAQControls.AxCWIMAQ..ctor()
   at Zonnon.empty1.MyForm..ctor() in D:\zonnontest\NIVision\empty1.znn:line 28
   at Zonnon.empty1._body() in D:\zonnontest\NIVision\empty1.znn:line 44
   at Zonnon.empty1.Main()


Logged
fnecati
Jr. Member
**
Posts: 60


« Reply #1 on: May 28, 2008, 09:04:02 AM »


Yes, it possible,  tested again with NationalInstruments' ActiveX wrappers.

In the previous message, I runned the program  on a computer where camera hardware (CameraLink Framegrabber) is not installed, only software drivers.

Today, I tested the program on a computer where camera driver/hardware is installed and ActiveX controls working on the Form without problem.

Thanks to Zonnon.



Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!