Forums (http://www.elitetrader.com/vb/index.php)
- Trading Software (http://www.elitetrader.com/vb/forumdisplay.php?forumid=3)
-- IB TWS API on 64-bit OS (http://www.elitetrader.com/vb/showthread.php?threadid=170704)


Posted by rbartell on 07-20-09 11:05 PM:

IB TWS API on 64-bit OS

Does anyone run the IB API on 64-bit? I got my computer last week and have been spending days trying to get the same programs to work on my new computer that were on my old 32-bit computer.

With IB's own sample application, I get the error: "An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" just trying to run the application - this happens at the line "Friend Class dlgMainWnd"

On my own program at the line "Tws1 = New AxTWSLib.AxTws" when I look at the AccessibilityObject Property for Tws1 it shows "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"

Normally I would have thought those errors would come from missing references, but that wouldn't be the case with the Sample Application that IB provides.

IB said that they have had troubles with people running 64-bit, but that this would fix:

1) uninstall TWS, Java and the API Components
2) installing Java 32 bit & reinstall TWS
3) install the API Components
4) Log back into TWS and try to run the Sample VB.net Application.

Well that didn't work for me and now nobody has any idea what to do.

If anyone has any idea as to what could cause this or had this happen, your insight would be much appreciated. Thanks.


Posted by dcraig on 07-20-09 11:24 PM:

I run it on Ubuntu 9.04 64 bit. No problems at all. Both 32 bit and 64 bit JVMs work.


Posted by tradelink on 07-20-09 11:32 PM:

you could try installing the 32 bit vc redistributable from microsoft, which IB's sample app requires.

alternatively you could install tradelink and the brokerserver for IB http://tradelink.googlecode.com, because I have several customers who run on 64bit with IB.

__________________
Free, Open-source .net trading platform:
tradelink.org


Posted by rbartell on 07-21-09 12:21 AM:

Thanks.
Per their suggestion, I already installed "Microsoft Visual C++ 2005 Redistributable Package (x86)" and that didn't fix.


Quote from tradelink:

you could try installing the 32 bit vc redistributable from microsoft, which IB's sample app requires.

alternatively you could install tradelink and the brokerserver for IB http://tradelink.googlecode.com, because I have several customers who run on 64bit with IB.


Posted by TrailingStop3 on 07-21-09 08:21 AM:

If you look at the IB-API Code you can see that the API is ‘only’ a simple protocol for the communication app <-> TWS over TCP/IP. I have developed an app which is available as native 32 and 64 Bit versions. I have redeveloped this communication to fit my needs, which wasn’t that difficult if you get the big picture of the API. I developed it in C++, so I have no idea how difficult it is to do the same in Java - but it should be possible?!

Daniel


Posted by makloda on 07-21-09 08:35 AM:

I'm running the API on Vista 64 bit and use Microsoft Excel to calculate and send orders to TWS. No problems at all.


Posted by dcraig on 07-21-09 08:59 AM:


Quote from TrailingStop3:

If you look at the IB-API Code you can see that the API is ‘only’ a simple protocol for the communication app <-> TWS over TCP/IP. I have developed an app which is available as native 32 and 64 Bit versions. I have redeveloped this communication to fit my needs, which wasn’t that difficult if you get the big picture of the API. I developed it in C++, so I have no idea how difficult it is to do the same in Java - but it should be possible?!

Daniel



Don't know why you would want to rewrite the Java API, but yes there would in principle be no problem doing so. Easier than C++.

The problem with doing this sort of hack job, is that in the future the protocol may change, but the supported API remains backward compatible. IB are under an obligation to provide backward compatibility for the API, but not the protocol.


Posted by TrailingStop3 on 07-21-09 09:05 AM:

If you want to compile a 64-Bit C++ program using the TWS-API you will run into the same sort of problems as rbartell is in. My solution for this was to rewrite it to get everything working with 64-Bit and 32-Bit. That’s the reason why I thought that it could also be a solution in Java – but – as written before – I’m not sure about that and do NOT want to rewrite the Jave API. I only want to tell my experience and the way I could fix the problem.


Posted by rbartell on 07-22-09 03:19 AM:


Quote from dcraig:

I run it on Ubuntu 9.04 64 bit. No problems at all. Both 32 bit and 64 bit JVMs work.



What made you choose Ubuntu? What are pros/cons (especially from a trading perspective)?


Posted by rbartell on 07-24-09 09:52 PM:

The problem was that the API uses a 32bit COM component. I had to add the line:

x86

to the first section of .vbproj file

More detail on how to do that:
http://msdn.microsoft.com/en-gb/vstudio/aa718685.aspx


Posted by aebrock on 08-26-09 09:10 PM:

some more info

Thanks for following up on this and posting the solution.

I had exactly the same problem with a C# application, compiled in Visual Studio 2008 on 64-bit Windows 7 RTM.

I had to do two things to get my project to work:
(1) As you point out, change the target platform from "Any" to "x86".
(2) Instead of creating the AxTws control dynamically, I have to put it directly in my windows form (i.e. put it in the toolbox, then drag it onto my form).

I can't remember where I saw this discussion, but apparently if you create the control dynamically, initialization may not be carried out properly. That's why I have to do Step #2 as well.


Posted by vikana on 08-27-09 04:43 AM:

Just want to chime in: I've been testing on 64 bit Ubuntu with 64 bit JVM for weeks now and it's running without any problems. Just upgraded to the latest TWS and API and so far no problems.

Just to clarify: I've been on 64 bit ubuntu for 18 months and tested against TWS many times. Recently I've begun preparing to go live, and have let the paper account trade on full auto just to see. That's what's going well.

__________________
Free your mind


All times are GMT. The time now is 12:09 PM.

Copyright © 2012 Elite Trader.