IB C++ API Error, access violation on reqMktData

Discussion in 'Data Sets and Feeds' started by walterjennings, Nov 20, 2007.

  1. Hey. Iv recently run into an unhandled exception / access violation in TwsSocketClient.dll. The exception occurs during a call to reqMktData.

    Iv been trying to solve this exception which is thrown from the TwsSocketClient.dll. unfortunately there is no way to see what inside the dll is causing the exception (i think).

    The exception is happening in a call to reqMktData. Originally I thought maybe I was not defining the Contract object correctly. Below is the boiled down code which still triggers the exception.

    Contract c;
    c.symbol = "EUR";
    c.secType = "FUT";
    c.currency = "USD";
    c.expiry = "200712";
    c.exchange = "GLOBEX";
    c.localSymbol = "";
    vector<ComboLeg*> comboLegs;
    comboLegs.clear();
    c.comboLegs = &comboLegs;
    mClientSocket->reqMktData(0, c, (CString)"", false);

    I am hoping that someone has run into this problem before and solved it. Any suggestions or answers would be extremely useful. In the worse case the EClientSocket object is being corrupted at some point in the application and it is not triggering an exception until the reqMktData call.

    I just attempted to place this code directly after the call to new EClientSocket and eConnect hoping to prove that EClientSocket object was being corrupted at some point in the app. Unfortunately the reqMktData call directly after the eConnect still triggers the exception.

    Is there something I am missing with the latest version of the API (non beta)? I am compiling this is MS VS 2005. Iv tried uninstalling tws/api, deleting the directory and reinstalling with no help. I am unsure which version of the API I was using before the recent reinstall, is there something different about the latest version of the API that requires me to change how my project compiles to make it work correctly?

    Thanks for your help.