PDA

View Full Version : Working with ActiveX client QAxWidget



InnoQT
29th January 2010, 10:28
Hello,

I can not get the output parameters returned by any of the functions I call using dynamicCall(). Could you help me?

I need to use an ActiveX control in my QT user interface, so I have create an instance of a QAxWidget. Then I modify several properties of the ActiveX without any problem. But I have problems to obtain the resulting values of any function I call using dynamic call. Here you have a sample of my code:


QAxWidget *activeX;
activeX = new QAxWidget(this);
activeX->setControl("{6E4688A6-4FCE-40FF-9D27-8AC603C7BF43}" );

activeX->setProperty("Asynch", false);//No problem with this sentence
activeX->setProperty("Acquire", true);//No problem with this sentence

QVariant miData;
//Signature of the GetRawData function in the ActiveX:
//HRESULT GetRawData( bool isPointer, VARIANT* pArray );
//isPointer [in] : If false returns the array of raw data, otherwise returns pointer to data.
// pArray [out,retval] : Pointer to the SAFEARRAY containing the raw data buffer.
activeX->dynamicCall("GetRawData(QBool,QVariant)",TRUE,miData);//Does not assign anything to output parameter miData

This ActiveX permits capturing from a specific digital video camera, and the output of this function should return a pointer to the first element of a array of bytes containing the image acquired by the camera.

More specifically my problems are two. First, how to obtain the output of the ActiveX functions in QT. And second, how to cast the QVariant into a more usable format like uchar*.

Thank you very much for your attention