Hi Govert,
What if we call RTD inside a UDF function like this:
var rtdResult = XlCall.RTD("My.Server", null, rtdParams.ToArray());
but write RTD server in such a way that it returns (in rtdResult) a key (the handle you mention) to some shared C# dictionary where result arrays are stored instead of actual data. But instead of the second function we process the handle inside UDF.
I do not know all details how RTD works, but what I do now is I pass object[,] serialized as string and deserialize it inside an UDF. Serialization is not a fast thing to do for large arrays, but the RTD update logic works as expected - that is, if UDF returns something dependent on RTD result but not the result itself the RTD server still starts and sends updates into the calling UDFs normally.
So after we get a new rtdResult, we lookup actual data and return it:
return StaticSharedClass.SharedData[ rtdResult.ToString() ];
What are the downsides/risks in this approach?
Thanks!
VB