Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NTDirect.dll and MarketData function(+)

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

    NTDirect.dll and MarketData function(+)

    Hello everyone

    Got a small problem. Having imported NTDirect.dll faced an interesting issue. Tying to call Market data results in an error: Couldn't load type ... because the method 'MarketData' has no implementation (No RVA). Any ideas? Thanks in advance. The code is below:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Collections;
    using MySql.Data.MySqlClient;
    using System.IO;
    using System.Runtime.InteropServices;

    namespace test1
    {
    class Test
    {
    [DllImport("NTDirect.dll")]
    public extern static int Connected(int showMessage);
    public extern static int SubscribeMarketData(string instrument);
    public extern static double MarketData(string instrument, int type);
    }

    public partial class Form1 : Form
    {
    private MySqlConnection conn;
    public Form1()
    {
    InitializeComponent();
    log(Test.Connected(11111).ToString());
    log(Test.SubscribeMarketData("ZB").ToString());
    log(Test.MarketData("ZB",1).ToString());
    }
    public void log(string txt)
    {
    outtxt.Text = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss") + " " + txt +
    Environment.NewLine + outtxt.Text;
    }
    }
    Last edited by greed999; 06-20-2012, 06:14 PM.

    #2
    Figured out, had to add [DllImport("NTDirect.dll")] before declaration of each function.

    Another issue: market data returns "0" instead of proper quotes. However connected and subscribe functions seem to have succeded (but they also return "0"). NT 7 is up and running. Flag AT is on. Have I missed something? Any help appreciated. Thanks in advance.
    Last edited by greed999; 06-20-2012, 06:23 PM.

    Comment


      #3
      Solved) Had to put "ZB 09-12" as a contract name.))

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      89 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      31 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      34 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      69 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X