Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to call NT7 .NET interface from Java, looks like it worked

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trying to call NT7 .NET interface from Java, looks like it worked

    I am not an expert of .NET so I decided to exploit my existing java knowledge to use NT. I've seen in the documentation you've removed COM interface (why?), I am not a COM expert too but all I know is .NET can be also seen as COM object from outside.

    The only free tool I could find on the net to call a com object from java is com4j.

    With such tool, I did run a command against your tlb definition (ninjiatrader.client.tlb) and got some usable java proxy to call your client, attaching them to the post.

    This is the sourcecode I am using to call your interface from java:

    Code:
    public static void main(String[] args)
            {
            _Client comObj = ClassFactory.createClient();
            IClient ntClient = comObj.queryInterface(IClient.class);
    
            int ret = ntClient.connected(0);
            System.out.println(ret);
            }
    This code is printing 0, as soon as I enable AT from within NT 7.
    I wondered if this could be a "safe" way to interop with your interface or would you suggest anything else? I could do everything in C# but I lose years and years of java exp, that'd be silly...
    Attached Files
    Last edited by Marzullo; 04-11-2010, 04:14 AM.

    #2
    Marzullo, creating an interface to the ATI with Java could certainly work but it is definitely unsupported.
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:10 AM
    0 responses
    3 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    9 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by elirion, Today, 01:36 AM
    0 responses
    4 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    4 views
    0 likes
    Last Post gentlebenthebear  
    Working...
    X