PDA

View Full Version : How to access OCX methods and events


joy
28th September 2006, 17:02
Hi,

I have one OCX file called SAMPLE.OCX and I registered that ocx by regsvr32.
It has 4 methods and 3 events.
I want to access the methods of that OCX file and get the signals of the OCX.

How to do in Qt-3.3.4 .?

Thanks

wysota
29th September 2006, 09:19
Is OCX the same as ActiveX? If so, you can use the ActiveQt (http://doc.trolltech.com/3.3/activeqt.html) framework.

joy
3rd October 2006, 16:31
Thanks,
I have used the ActiveQt classes for this task.
I have given my sample code.

QAxWidget* sampleWidget = new QAxWidget();
sampleWidget->setControl( //{8E27C92B-1264-101C-8A2F-040224009C02}// ); // UID taken from regedit

QObject::connect( (QObject*) sampleWidget, SIGNAL(OnReturn()), this, SLOT(returnResponse()) );

sampleWidget->dynamicCall( "doProcess(QString&)", lstring);

#) dynamicCall() method not accessing that particular method
#) response also not received for OnReturn() signal.

Anything I have to do?

Thanks