Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with CWIMAQVision.ReadImage() in C#

Hi,

 

I want to load a .bmp file saved on my harddisk and show it in a CWIMAQViewer. I use C#.

 

My code:

NationalInstruments.CWIMAQControls.CWIMAQVisionClass objVision = new NationalInstruments.CWIMAQControls.CWIMAQVisionClass();

NationalInstruments.CWIMAQControls.CWIMAQImage myImageLoad = new NationalInstruments.CWIMAQControls.CWIMAQImage();

axCWIMAQViewer1.Attach(myImageLoad);

objVision.ReadImage(myImageLoad, sPath, axCWIMAQViewer1.Palette); //<<<< this throws an Exception

 

But the ReadImage() method throws the Exception:

"Fatal Error (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"

 

What do i do wrong?

0 Kudos
Message 1 of 2
(6,167 Views)

Sorry, wrong board.

Moved to > Machine Vision <

http://forums.ni.com/ni/board/message?board.id=200&thread.id=22668

0 Kudos
Message 2 of 2
(6,166 Views)