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 burtoninlondon, Today, 12:38 AM
    0 responses
    5 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    12 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X