Here is my code for getting for connecting my application to the RTD server
using System;
using System.Drawing;
using System.Windows.Forms;
using NESTClientLib;
namespace NestToAmi
{
public partial class Form1 : Form
{
public static dynamic AmibrokerObj { get; set; }
public static IScripRTD NestRTDObj { get; set; }
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int TopicId = 0;
object[] SymbolList = new object[2];
TopicId = 1;
SymbolList[0] = "nse_cm|ITI-EQ";
SymbolList[1] = "LTP";
NestRTDObj.ConnectData(TopicId, SymbolList, true);
}
public void button4_Click(object sender, EventArgs e)
{
try
{
IScripRTD NestRTDObj = new ScripRTD(); // COM object RTD server
}
catch (Exception ex)
{
MessageBox.Show("Nest Trader Interface Error. Check Nest Trader Is Opened or Not \r\n" + ex);
}
}
}
}
I wanted to access NestRTDObj (COM object) created in button4_Click to the button1_Click. Please help me in this case. I tried to access this object as public variable but am doing something wrong.