CMagickImage->Convert returns "Unknown vt type = 524

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
proover

CMagickImage->Convert returns "Unknown vt type = 524

Post 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?
proover

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

Post by proover »

Anybody please? Has nobody ever used this method?
Post Reply