RTD server : Updatenotify does not return and Excel not calling refreshData method

K

kamesh

Hi,
I have implemented an RTD server in c#
Its working fine in 2003 but when I use excel 2007 the cell values sto
updating after while.

Here is my logic for refreshdata and update notify

I have used alreadyNotified flag to make sure that there are n
excessive updatenotify calls which might make excel unresponsive

public System.Array RefreshData(ref int TopicCount){
Console.WriteLine("entering RefreshData "
Thread.CurrentContext.ContextID);

alreadyNotified = false;

// Logic to update the excel sheet cells

Console.WriteLine("already notified set to FALSE");
Console.WriteLine("exiting refresh data "
Thread.CurrentContext.ContextID);
return obs;
}




// This is called when we receive new values

private void notifyExcel(){

Console.WriteLine(" ------- ENTERING NOTIFY EXCE
-----------");
Console.WriteLine("already notified flag is : "
alreadyNotified);
if (m_xlRTDUpdate != null && !alreadyNotified)
{
alreadyNotified = true;
Console.WriteLine("already notified set to TRUE");
Console.WriteLine("before update notify");
m_xlRTDUpdate.UpdateNotify();
Console.WriteLine("after update notify");
}
Console.WriteLine(" ******** EXITING NOTIFY EXCEL *************");
}


when I have debugged it for a while, the values stopped streaming and m
logs showed the following:


09/07/2012 19:16:47 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:47 already notified flag is : False
09/07/2012 19:16:47 already notified set to TRUE
09/07/2012 19:16:47 before update notify
09/07/2012 19:16:47 after update notify
09/07/2012 19:16:47 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:47 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:47 already notified flag is : True
09/07/2012 19:16:47 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:47 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:47 already notified flag is : True
09/07/2012 19:16:47 already notified set to TRUE
09/07/2012 19:16:47 before update notify
09/07/2012 19:16:47 exiting refresh data 0
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:48 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:48 already notified flag is : True
09/07/2012 19:16:48 ******** EXITING NOTIFY EXCEL *************
09/07/2012 19:16:49 ------- ENTERING NOTIFY EXCEL -----------
09/07/2012 19:16:49 already notified flag is : True

The logs show that last update notity method does not return at all

I am not sure how do it solve this problem and this is happening ever
time

Can some one please point me in right direction in solving this


Thanks,
kams.
 
A

Auric__

kamesh said:
I have implemented an RTD server in c#
Its working fine in 2003 but when I use excel 2007 the cell values stop
updating after while.

Here is my logic for refreshdata and update notify

I have used alreadyNotified flag to make sure that there are no
excessive updatenotify calls which might make excel unresponsive [snip]
The logs show that last update notity method does not return at all

I am not sure how do it solve this problem and this is happening every
time

Can some one please point me in right direction in solving this

I'd suggest asking in the group comp.os.ms-windows.programmer.win32.
 
K

kamesh

Thanks
I have found the problem, excel 2007 throws an exception when ever it i
busy and not ready to handle the request.

Solved the issue by catching the exception and added a timer to notif
agai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top