Excel RTD not working in deployment - C#

Posted by Peermohamedmydeen under C# on 8/26/2010 | Points: 10 | Views : 4445 | Status : [Member] | Replies : 0
Hi All,
Am working in a windows application which involves in real time data..

In Some forms it requires Excel RTD....
I have written an RTD Class from IRtdServer Interface.
I have implemented the interface methods as well.
I have given the following attributes:

[Guid]
[ProgId]
[Comvisible(true)]


RTD is working in development environment perfectly.
I have added the reference of RTD dll in my User Interface.
When I bulid the setup and deploy in another machine RTD is not working...
In excel sheet its showing N/A..
But in Excel 2007 its working.

I think i made something wrong with COM intereoperability.

I dont know whether the dll not get registered or problem with the COM.
Please help me...


using System;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Excel;
using System.Collections.Generic;

namespace MVXXL
{
[Guid("28B77679-5A73-4ae0-BE00-3D3A667AB135")]
[ProgId("MVX")]
[ComVisible(true)]

public class RTDFunctions : IRtdServer
{
private IRTDUpdateEvent m_callback;
private System.Windows.Forms.Timer m_timer;
private int m_topicId;
private IDictionary<int, string> m_topics = new Dictionary<int, string>();
RTDSource objRTDSource;
bool isDataFetched = false;

public int ServerStart(IRTDUpdateEvent callback)
{
InitializeRTDSource();
m_callback = callback;
m_timer = new System.Windows.Forms.Timer();
m_timer.Tick += new EventHandler(TimerEventHandler);
m_timer.Interval = 500;
m_timer.Start();
return 1;
}

public void ServerTerminate()
{
if (null != m_timer)
{
m_timer.Dispose();
m_timer = null;
}
}

public object ConnectData(int TopicID, ref Array Strings, ref bool GetNewValues)
{
string strReturn = string.Empty;
string ReqTopic = string.Empty;
if (Strings.Length >= 1)
{
try
{
ReqTopic = Strings.GetValue(0).ToString();
if (isDataFetched == false)
{
objRTDSource.GetAllRTDDataFromWebService(ReqTopic);
isDataFetched = true;
}
}
catch (Exception ex)
{
return &quot;Data Not Found.&quot;;
}
}
if (!m_topics.Keys.Contains(TopicID))
{
m_topics.Add(TopicID, ReqTopic);
}
GetNewValues = true;
return strReturn;
}

public void DisconnectData(int topicId)
{
m_timer.Stop();
}

private void TimerEventHandler(object sender, EventArgs args)
{
m_timer.Stop();
m_callback.UpdateNotify();
}

public Array RefreshData(ref int TopicCount)
{
object[,] data = new object[2, m_topics.Count];
int idx = 0;
foreach (int topic in m_topics.Keys)
{
data[0, idx] = topic;
data[1, idx] = objRTDSource.GetValueForATopic(m_topics[topic]);
++idx;
}
TopicCount = m_topics.Count;
m_timer.Start();
return data;
}

public int Heartbeat()
{
return 1;
}

private void InitializeRTDSource()
{
if (objRTDSource == null)
{
objRTDSource = new RTDSource();
}
}
}
}


Thanks in advance...
PMM :)




Responses

(No response found.)

Login to post response