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

    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 sjsj2732, Yesterday, 04:31 AM
      0 responses
      39 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      289 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      289 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      135 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      96 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X