1

I successfully can access Get method of class by ActiveX, but can't access Let property.

QAxObject *p = new QAxObject( "MyApp.Application", 0 );
p->dynamicCall("Signals(const QString& )","Sig0");// this will issue GET
p->dynamicCall("Signals(const QString& ,int)","Sig0",1);// doesn't work 

VB code :

Public Property Get Signal(ByVal Key As Variant) As Long
Debug.Print Key
End Property

Public Property Let Signal(ByVal Key As Variant, ByVal Value As Long)
Debug.Print Key _ Value
End Property

My goal is to issue Let method.

  • How does that COM object typelibrary look like? – Alexander V Aug 01 '16 at 18:03
  • There are two items: [id(00000000), propget] long Signal([in] VARIANT Key); [id(00000000), propput] void Signal( [in] VARIANT Key, [in] long rhs); – Dmitry Chikov Aug 03 '16 at 14:16
  • You use "Signals". Plural? The interface shows singular "Signal". And maybe p->dynamicCall("Signals(const QString& ,int)","Sig0",1); should be p->dynamicCall("Signal(const QString& ,long)","Sig0",1); then. – Alexander V Aug 03 '16 at 18:57
  • I know . it can be translated to OBJ->SIGNALS->SIGNAL("something") it doesn't matter The question is how to run Second "propput". When I use dynamic call I always get propget. – Dmitry Chikov Aug 03 '16 at 20:37
  • QAxObject *p = new QAxObject( "MyApp.Application", 0 ); p = p->querySubObject("Signals"); p->dynamicCall("Signal(const QString& ,int)","Sig0",1);// doesn't work – Dmitry Chikov Aug 03 '16 at 20:40
  • I only do Qt's own dumpcpp and then use the imported definitions in my projects. There problems and glitches with it but it is not run-time but compilable solution for interfaces and more like ATL. I also mix code with ATL by putting ATL #import in a separate module when I cannot get Qt's import to work. Also, please try to put "long" instead of "int" in the string Qt definition for the "put" method. – Alexander V Aug 03 '16 at 21:09
  • I tried. I should glance at QAxBase dynamicCall source . Because I suspect that dynamicCall executes only the first occurrence – Dmitry Chikov Aug 04 '16 at 17:40

1 Answers1

0

The solution is to use IDispatch method. Problem was that Qt library assumes that property Set(PUT) accepts only one parameter but in my case I need Put with two parameters. this article helped me to solve it: https://support.microsoft.com/en-us/kb/216686