I am using the CMagickImage class via COM in my C++ project. Here is the code:
Code: Select all
CMagickImage* t_Image = new CMagickImage();
SAFEARRAYBOUND aDim[1];
CComSafeArrayBound bound[1];
bound[0].SetCount(2);
bound[0].SetLowerBound(0);
CComSafeArray<VARIANT> args(bound);
CComVariant vt("C:\\1.jpg");
HRESULT hr = vt.Detach(&args[0]);
CComVariant vt2("C:\\1.bmp");
HRESULT hr2 = vt2.Detach(&args[1]);
t_Image->Convert(args.GetSafeArrayPtr());
I am working in Visual Studio 2005. VS included CMagickImage.h into my solution. In CMagickImage.h the Convert-method reads as follows:
Code: Select all
VARIANT Convert(SAFEARRAY * * pArrayVar)
{
VARIANT result;
static BYTE parms[] = VTS_UNKNOWN ;
InvokeHelper(0x6, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms, pArrayVar);
return result;
}