PDA

View Full Version : How to access OCX methods and events



joy
28th September 2006, 16: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, 08: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, 15: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

atefe
1st May 2018, 14:29
You can use dumpcpp.exe to create a class and use the methods simply.
just run Run CommandPrompt Qt5.5 64bit for desktop
then write the bin address for Qt for example :
D:\Qt\Qt5.5.1\5.5\msvc2013_64>cd bin
then run dumpcpp.exe and write the ClassId , for exmaple
D:\Qt\Qt5.5.1\5.5\msvc2013_64\bin\dumpcpp -nometaobject {6DC390A4-4DE4-46CC-AEA6-B36F364CA9B0}//CLSID

d_stranz
1st May 2018, 16:37
If you are using Visual Studio with the Microsoft compiler toolchain, you can also use the #import directive with the type library or DLL name to do essentially the same thing without having to run an external tool. However, dumpcpp looks like it has additional options which might be useful in some circumstances.