Menu

#709 "Parameter not optional" when writing to property (ActiveQt)

v1.0 (example)
closed-fixed
nobody
None
5
2016-01-12
2015-12-18
No

I'm experiencing problems writing to a property in an ActiveX component implemented in Qt. Property reads work fine, but property writes gives an "Parameter not optional" error.

Problem report with reproducer: https://bugreports.qt.io/browse/QTBUG-49712 . I've already receviced response from Qt support that the problem most likely resides on the PyWin32 side.

Discussion

  • Fredrik Orderud

    Fredrik Orderud - 2015-12-18

    The problem seem to be an incorrect "invoke_type=3" value for the Invoke()-call to the ActiveX property put. Changing the invoke_type manually to 4 before calling Invoke() in CDispatch.setattr [dynamic.py line 538] fixes the problem.

    IDL and typelib files attached. I cannot see anything wrong with the "label" property in the IQSubWidget interface that should lead to the property only being readable and not writable from pywin32.

     

    Last edit: Fredrik Orderud 2015-12-19
  • Mark Hammond

    Mark Hammond - 2015-12-19

    That means the typelib for the object is probably wring - this invoke_type comes directly from that typelib.

     
  • Fredrik Orderud

    Fredrik Orderud - 2015-12-19

    I've now uploaded IDL & typelib files to the comment above. Please let me know if you also would like precompiled binaries to ease debugging.

     
  • Fredrik Orderud

    Fredrik Orderud - 2015-12-20

    Patch that fixes the problem for me: https://sourceforge.net/p/pywin32/patches/155/

     

    Last edit: Fredrik Orderud 2015-12-30
  • Fredrik Orderud

    Fredrik Orderud - 2016-01-12

    The problem now seem to be solved with PyWin32 build 220.

     
  • Mark Hammond

    Mark Hammond - 2016-01-12

    Thanks!

     
  • Mark Hammond

    Mark Hammond - 2016-01-12
    • status: open --> closed-fixed