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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    117 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    166 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    85 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    130 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    88 views
    0 likes
    Last Post PaulMohn  
    Working...
    X