"Parameter not optional" when writing to property (ActiveQt)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
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.
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
That means the typelib for the object is probably wring - this invoke_type comes directly from that typelib.
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.
Patch that fixes the problem for me: https://sourceforge.net/p/pywin32/patches/155/
Last edit: Fredrik Orderud 2015-12-30
The problem now seem to be solved with PyWin32 build 220.
Thanks!