This is my first time here, so I hope I meet the expectations for the forums.
I am trying to make a futures contracts trading program interfacing with interactive brokers' twsapi. I found some c code which seems to make the interface simple, but I'm getting compiler errors that I have never seen before.
I have a market class and a cell class. the market class contains a 2d array of cells in addition to other information like the current trading price etc...
Here is how my files depend on eachother right now (arrows point to included files):
the TWSAPI essentially gives me a void event_update(data, data, data) function to override, which is called whenever data is received from the server. I need to take that data and store it in my market class. The problem is that I can't access my market object from within the function. Unless it is passed as a parameter, I can't think of how to do this, and I haven't been successful with passing it in as a parameter because I'm trying to pass a class through a c function. I could sure use some help here. I feel like there should be a way to declare my market as a global or change the twsapi.c into a cpp file (I'm not sure if this is as easy as I think it should be). I signed a NDA and some of the code is not allowed to become public so if you need to see code, let me know and I'll give everything I can.Code:main.cpp | \/ TWSAPI.h <--- TWSAPI.c | \/ market.h <--- market.cpp | \/ cell.h <--- cell.cpp
Thanks for your time.