I'm calling tws activex control from qt, the code is as follows,
QAxWidget *twsControl = new QAxWidget(0,0);
bool ret = twsControl->setControl("Tws.TwsCtrl");
twsControl->dynamicCall("connect(QString,int,int)", "127.0.0.1", 4001, 100);
When I trace into the dynamicCall, I get hres = DISP_E_PARAMNOTOPTIONAL in the line:
HRESULT hres = disp->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, disptype, ¶ms, res, &excepinfo, &argerr);
If I call disconnect funtion in activex, the above line return S_OK,
twsControl->dynamicCall("disconnect()");
If I call cancelMktData() function in activex: twsControl->dynamicCall("cancelMarketData(int)", id), it is also ok.
So it seems something wrong with the first parameter in connect function. but I don't know how to fix it. Does anyone have a clue?
QAxWidget *twsControl = new QAxWidget(0,0);
bool ret = twsControl->setControl("Tws.TwsCtrl");
twsControl->dynamicCall("connect(QString,int,int)", "127.0.0.1", 4001, 100);
When I trace into the dynamicCall, I get hres = DISP_E_PARAMNOTOPTIONAL in the line:
HRESULT hres = disp->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, disptype, ¶ms, res, &excepinfo, &argerr);
If I call disconnect funtion in activex, the above line return S_OK,
twsControl->dynamicCall("disconnect()");
If I call cancelMktData() function in activex: twsControl->dynamicCall("cancelMarketData(int)", id), it is also ok.
So it seems something wrong with the first parameter in connect function. but I don't know how to fix it. Does anyone have a clue?