CMagickImage->Convert returns "Unknown vt type = 524
Posted: 2007-02-02T09:54:59-07:00
Hello,
I am using the CMagickImage class via COM in my C++ project. Here is the code:
Convert always returns Unknown vt type = 52428, althought the SAFEARRAY is set properly (at least when looking at the variables while debugging and the stack trace).
I am working in Visual Studio 2005. VS included CMagickImage.h into my solution. In CMagickImage.h the Convert-method reads as follows:
Any suggestions please?
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;
}