Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default RTD C# implementation on vs2005

Hi All,

I have written a simple RTD Server C# implementation using vs2005 but I am
having trouble making it run. When I run this DLL with external app set as
Excel using vs2005 in debug mode, it pops out Excel app. But I receive the
#N/A value when I input =RTD("Excel_RTD_Demo.Class1",,"blah") in one of the
cells. I also get this on the output window in vs2005:
'EXCEL.EXE' (Managed): Loaded
'c:\windows\microsoft.net\framework\v1.1.4322\msco rlib.dll', No symbols
loaded.
A first chance exception of type 'System.IO.FileNotFoundException' occurred
in Unknown Module.

I don't have actual COM coding experience and I just began to pick up VS2005
recently. Does anyone have similar issue in writing RTD in VS2005? Any help
is appreciated.

Here is a copy of the RTD Server.

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

namespace Excel_RTD_Demo
{
[Guid("40d7bff1-20ed-490e-88ab-59a759ec4a86")]
public class Class1 : Excel.IRtdServer
{
private Excel.IRTDUpdateEvent callBackObject = null;
private int topicId;
private Timer atimer = new Timer();

public int ServerStart(Excel.IRTDUpdateEvent CallbackObject)
{
atimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
atimer.Interval = 3000;
atimer.AutoReset = true;
atimer.Enabled = true;
callBackObject = CallbackObject;
return 1;
}

public void ServerTerminate()
{
callBackObject = null;
}

public object ConnectData(int TopicID, ref Array Strings, ref bool
GetNewValues)
{
topicId = TopicID;
return "Connecting...";
}

public void DisconnectData(int TopicID)
{
}

public int Heartbeat()
{
// check if data source is active
return 1;
}

public Array RefreshData(ref int TopicCount)
{
TopicCount = 1;
object[,] results = new object[2, 1];
Random gen = new Random(DateTime.Now.Millisecond);
results[0, 0] = topicId;
results[0, 1] = gen.Next().ToString();
return results;

}

private void OnTimedEvent(object source, ElapsedEventArgs e)
{
callBackObject.UpdateNotify();
}

}
}

Thanks,
Sheldon
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementation Guidance [email protected] Excel Programming 1 July 3rd 07 02:06 AM
Access embedded forms controls from VS2005 Gabriel Excel Programming 0 April 17th 07 03:00 PM
System.AccessViolationException on VS2005 and Microsoft.Office.Int Otacon Excel Programming 0 October 25th 06 05:29 PM
Problem deploying an automation addin (VS2005, Windows XP SP1, Excel XP) BlueTrin Excel Programming 1 June 6th 06 11:29 AM
Charts and VS2005 B2 tbonejo Excel Programming 0 September 29th 05 03:30 PM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"