The object cache doesn't contains topicids. It just contains internal
ids (strings in my case).
The RTD server contains a dictionary with the links between internal
ids and topic ids (one internal id can be related to many topicids).
If it can help you, I will describe my workflow :
1) The user builds an object Foo with a UDF called "BuildFoo" in a
sheet range (let's say "A1"), with an internal identifier (let's call
it "FooId1") in input parameters.
BuildFoo first calls XlCall.RTD(..., FooId1,...), then it asks to the
cache whether FooId1 already exists, in that case it does nothing
more. If FooId1 didn't exist, a new Foo is created with that internal
identifier.
Finally, in all cases BuildFoo returns a string like
"FooId1::ddMMyy_hh.mm.ss" where "ddMMyy_hh.mm.ss" is a timestamp (last
update time).
The RTD server has been called by XlCall.RTD(..., FooId1,...) through
"ConnectData" interface. Thus it adds the topicid to its dictionary
(Dictionary<string, int>, where "int" value is for the topic id and
"string" value is the internal id).
2) In another range ("B1"), the user enters a UDF call, depending on
"A1", something like "CalculateWhatever(A1, ...)".
3) Finally, something modifies the Foo object (because of another UDF
call or whatever). The cache raises an event "FooObjectModified" which
RTD server subscribed to. The event argument contains the internal
identifier of the foo object.
Then the RTD server notifies the callback (IRTDUpdateEvent given by
"ServerStart"), and store the internal id in a temporary list.
Finally, "RefreshData" will return an Array containing all the
topicids related to the stored internal ids (don't forget to clear the
temporary list after).
In that case, Excel will call again the building function in "A1",
which won't build again the Foo as it already exists in cache, but it
will just return the "FooId1::ddMMyy_hh.mm.ss" with a new timestamp
(the last update time).
4) Finally, "A1" range has been automatically updated by RTD server
(the timestamp has changed). "B1" depends on it so it will be updated
too.
I hope it's understandable.
Regards,
Ron