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?
ActiveX is an outdated and very error prone technology. Why would you use the activeX control and not C# or Java or C++ solutions?
I'm linking my Qt program with tws api, is there any other way to do that? I tried to port TwsSocketClient to Qt, but I found the TwsSocketClient using mfc socket class, so I gave up and turned to activex.
why you cannot interface with .Net 4.0 via mixed mode assembly? http://stackoverflow.com/questions/...xed-mode-net-assembly-in-qt-4-8-4-application
Check the signature required for calling eConnect, IB APi documentation may be not be up to date. Always check release notes. Newer API versions need extra bool at the end of argument list for authorization required. Try "false" and see if it works. I do not use Qt as it is extra framework to carry around so this is not specific qt answer. I am away from my developer machine so this is what I remember, and do not know for which version this requirement was added.