ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CWMachineVision.SetupViewerForLineSelection.

Hi
I want to programmaticalyset the ROI of a CWIMAQViewer.

When i use CWMachineVision.SetupViewerForLineSelection(CWIMAQViewer) i have an exception thrown.


Exception : Impossible to CAST a  AxCWIMAQViewer to CWIMAQViewer

 

Thanks for your help

0 Kudos
Message 1 of 4
(3,514 Views)
Your function should be CWMachineVision.SetupViewerForLineSelection(CWIMAQViewer.GetCWIMAQViewer()).  That will get your viewer in the correct format.
Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,488 Views)

Hi
Thanks for the response i will try...
Wh do we have 2 type AxcWimaqViewer which is the Active X object and the Type CWImaqViewer which is i suppose the handle of the AxCwimaqViewer

0 Kudos
Message 3 of 4
(3,483 Views)

kikou -

 

This is a limitation of the current .NET API, which was directly converted from Visual Basic 6.  In our upcoming release, we will have a native .NET API that should avoid many of these confusing issues.

 

Greg Stoll

Vision R&D

National Instruments

Greg Stoll
LabVIEW R&D
0 Kudos
Message 4 of 4
(3,479 Views)