I'm very new to PyQt5. I'm now trying to call ocx function which takes VARIANT* type as argument. So I created QVariant variable and toss it into the function, but I can get nothing but only error.
The function prototype is:
LONG ReceiveProcDataArr(LONG nRqID, BSTR sProc, LONG nOutRecIndex, VARIANT* pArrData)
and i tried to use this with following code:
from PyQt5.QtCore import QVariant
ocx_module = QAxWidget("[ocx control]")
# some codes to skip...
data = QVariant()
item_length = ocx_module.dynamicCall("ReceiveProcDataArr(int, QString, int, QVariant&)", [rqID, proc, 0, data])
and I got error:
Error calling IDispatch member ReceiveProcDataArr: Type mismatch in parameter 3
I can use "ocx_module" which does not take argument or takes only int/string type such as:
success = ocx_module.dynamicCall("Init()")
success = ocx_module.dynamicCall("Login(QString, QString)", user_id, user_pw)
My environment is:
- windows 10 pro
- python 3.6 x86
- pyqt5 == 5.9
I searched for a while, but I cannot find answer about this. Can anyone help me?