RTDServer functions missing

Add-in Express™ Support Service
That's what is more important than anything else

RTDServer functions missing
 
Jon Chen


Guest


Hi,

I am wondering why Add-in express's implementation of TRTDServer doesn't include 'ServerStart', 'HeartBeat'. ServerStart is supposed to receive a callback routine for data update notification. The OnConnectData is there but it doesn't seem to called at all.

Below are the list of functions posted in Microsoft support site:

ServerStart
Called when Excel requests the first RTD topic for the server. ServerStart should return a 1 on success, and a negative value or 0 on failure. The first parameter of the ServerStart method is a callback object that the RealTimeData server uses to notify Excel when it should gather updates from the RealTimeData server.

ServerTerminate
Called when Excel no longer requires RTD topics from the RealTimeData server.

ConnectData
Called whenever Excel requests a new RTD topic from the RealTimeData server.

DisconnectData
Called whenever Excel no longer requires a specific topic.

HeartBeat
Called by Excel if a given interval has elapsed since the last time Excel was notified of updates from the RealTimeData server.

RefreshData
Called when Excel is requesting a refresh on topics. RefreshData is called after the server notifies Excel that updates exist, and it returns a count of the topics to update along with the topic id and value for each topic.

Please advise.
Thanks.

Jon Chen
Posted 09 Nov, 2007 15:30:31 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Jon,

I am wondering why Add-in express's implementation of TRTDServer doesn't include 'ServerStart', 'HeartBeat'.


The ServerStart method is implemented by the Add-in Express code. You get the OnRTDInitialize event.

The HeartBeat method is implemented by the Add-in Express code. You don't get any event because:
---
HeartBeat is called by Excel if a particular interval has elapsed since the last time Excel was notified of updates from the RealTimeData server. HeartBeat permits Excel to determine if the real-time data server is still active. The pfRes parameter must be filled with "0" or a negative number to indicate failure. A positive number indicates success.
---

The OnConnectData is there but it doesn't seem to called at all.


You can use the OnConnect event of the TadxRTDTopic component. The OnConnectData event is intended for handling topics created by the end-user on the fly and don't exist in your RTD module.


Posted 12 Nov, 2007 05:34:21 Top
Jon Chen


Guest


Thanks for the reply.


The ServerStart method is implemented by the Add-in Express code. You get the OnRTDInitialize event.


If OnRTDInitialize event is to replace ServerStart, how do I pass a callback routine to the RTDServer, so I can send a UpdateNotify when data is ready? Without this callback routine, I don't think push/pull mechanism is possible as it is a powerful feature promised by Microsoft on RTD.


The HeartBeat method is implemented by the Add-in Express code. You don't get any event because:
---
HeartBeat is called by Excel if a particular interval has elapsed since the last time Excel was notified of updates from the RealTimeData server. HeartBeat permits Excel to determine if the real-time data server is still active. The pfRes parameter must be filled with "0" or a negative number to indicate failure. A positive number indicates success.
---


What is the routine/event in Add-in Express that has the pfRes parameter?



You can use the OnConnect event of the TadxRTDTopic component. The OnConnectData event is intended for handling topics created by the end-user on the fly and don't exist in your RTD module.


I could not find OnConnect event of TadxRTDTopic component.
If OnConnectData event is intended for handling topics created by end-user on the fly, can you give me an example?


Thanks.

-Jon

Posted 12 Nov, 2007 08:32:12 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Jon,

If OnRTDInitialize event is to replace ServerStart, how do I pass a callback routine to the RTDServer, so I can send a UpdateNotify when data is ready? Without this callback routine, I don't think push/pull mechanism is possible as it is a powerful feature promised by Microsoft on RTD.


You can use the UpdateTopics method of your RTD module.

What is the routine/event in Add-in Express that has the pfRes parameter?


That was an MSDN quotation. The C++ pfRes parameter is the Result in Delphi terms. In the Add-in Express code there is the following implementation of the Heartbeat method of the IRtdServer interface.

function TadxRTDServer.Heartbeat: Integer;
begin
Result := 1;
end;

I could not find OnConnect event of TadxRTDTopic component.


Please install the latest version of Add-in Express.

If OnConnectData event is intended for handling topics created by end-user on the fly, can you give me an example?


I will create an example for you within a couple of hours and let you know.


Posted 12 Nov, 2007 08:51:23 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Jon,

The example is ready. There is no design-time TadxRTDTopic components in the RTD module, all topics requested by the end-user are created in the OnConnectData event handler.

http://www.add-in-express.com/projects/adx-rtd-on-connect-data-d7.zip




Posted 12 Nov, 2007 09:36:56 Top