Hi, I'm trying to use the CWIMAQViewer to load and display a bitmap from a .bmp file on my hard drive.
I program an MFC apllication.
I use:
m_Image1 = m_Vision.CreateCWIMAQImage();
CCWIMAQPalette somePalette = m_Viewer1.get_Palette();
unePal.SetType(4096);
m_Viewer1.Attach(m_Image1);
m_Vision.ReadImage(m_Image1, "C:\\scr2.bmp", somePalette );
Of course it doesn't work becasue ReadImage wants a VARIANT for the last parmeter ColorPalette.
This last parameter should be optional, but of course, it is not.
If I try to redefine the ReadImage function in my wrapped CWIMAQVision class :
long ReadImage(LPDISPATCH DestImage, LPCTSTR Path) //, VARIANT ColorPalette)
{
long result;
static BYTE parms[] = VTS_DISPATCH VTS_BSTR VTS_VARIANT ;
InvokeHelper(0x107, DISPATCH_METHOD, VT_I4, (void*)&result, parms, DestImage, Path); //, &ColorPalette);
return result;
}
Then, it compiles, it runs, but doesn't work because some exception is catched in OleDisp.cpp.........
plesae:
How to simply Read an Image in VC++
in order to make a CWIMAQImage
that will be displayed in the nice CWIMAQViewer ?
thanks.