Page 1 of 1

CMagickImage->Convert returns "Unknown vt type = 524

Posted: 2007-02-02T09:54:59-07:00
by proover
Hello,


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());
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:

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;
	}
Any suggestions please?

Re: CMagickImage->Convert returns "Unknown vt type = 524

Posted: 2007-02-06T02:17:52-07:00
by proover
Anybody please? Has nobody ever used this method?