Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to find entry point (connecting to a dll)

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

    Unable to find entry point (connecting to a dll)

    Hi, I have created a very simple .dll and saved it on my computer as
    C:\ClientTraderConnectionClass.dll.

    The code used to create this class is:

    Code:
     namespace ClientTraderConnectionClass
    {
        public static class StopLosses
        {
            public static double GetTest()
            {
                return 10;
            }
        }
    }
    I want in indicator inside NinjaTrader to call the "ClientTraderConnectionClass.StopLosses.GetTes t()" function, but so far I'm not sure exactly how to do that. Here is the code I have in my indicator, which is throwing the error "Unable to find entry point "GetTest()"

    Code:
    public class StopLosses : Indicator
        {
            [DllImport("C:/ClientTraderConnectionClass.dll")]
            public static extern double GetTest();
    
            protected override void OnBarUpdate()
            {
                try 
                {
                    TestNumber.Set(GetTest());
                }
                catch(Exception ex) 
                { 
                    TestNumber.Set(-5);
                }
            }
        }
    Can someone please help me setup this function correctly? I have also tried using the line:

    TestNumber.Set(ClientTraderConnectionClass.StopLos ses.GetTest()); to no avail.

    Thanks in advance,
    Ben

    #2
    Unfortunately that is beyond what we provide support for. As last resort you could contact a certified NinjaScript consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm
    DierkNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Unfortunately that is beyond what we provide support for. As last resort you could contact a certified NinjaScript consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm
      Thanks Dierk, I know that ... am used to reading it from you on this forum... Hoping other developers out there might read the thread and have something to offer

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by M_ichel, Today, 08:38 AM
      0 responses
      1 view
      0 likes
      Last Post M_ichel
      by M_ichel
       
      Started by soon123, Today, 12:18 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by space_trader, Today, 12:52 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by ybhx0315, Yesterday, 09:06 PM
      0 responses
      21 views
      0 likes
      Last Post ybhx0315  
      Started by parkinsonbr, Yesterday, 08:23 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X