1. Why:
CLSID clsId = Guid.NewGuid(); //random clsId each time
Stable Id works as good and doesnt trash registry.
2. ServertTerminte in RtdServerWrapper calls UnregisterRTDServer which removes current instance from loaded servers list. Is there any particular reason for that? It lead to situation when excel calls directly into wrapper, but XlCall.RTD activates new instance. I solved this by not unregistering instance, it works fine. I believe this implementation works for original implementation when each time when rtd instance not found new one is created, so this place is just for cleanup?
Regards,
Arnas
1. I was referring to Serges solution where he registers RtdServerWrapper with RegisterRTD method. Its nice solution just and it works, just I noticed it trashed registry with clsids. However it works and I can use same id each time so no big deal.
2. If I use solution above, when server terminates it cleans instance created by solution above. thats my concern.
Regarding registering rtd as com, i am comming from this solution implemented using com. If I register it as HKEY_CURRENT_USER it just doesnt work with UAC enabled (win7 x64, office 2010 32)! So i need admin to deploy RTD, which causes headache, so reg free deployment (or autoregister w/o admin priviledge) would be my preference.
Regards,
Arnas
All I need to do get newValues flag set correctly (newValues == false) when I open existing workbook. So it is completely relevant to this thread as solution provided by Serge is almost perfect, so I just needed to clarify couple of questions arose. I just want to finalize solution described by Serge, I dont see need to go back to non wrapped Rtd server.
Regards,
Arnas
My solution is .28-specific because I didn't have the luxury of using Govert's improvements to .29. That said, I haven't felt the need to upgrade to .29 to take advantage of the new RTD stuff because my method has been extremely stable for my users. To answer your question-- I did not actually use the random CLSID and instead hardcode the CLSID for my RTD. I never delete that from the registry. Thus all of my users have that one entry in their registry forever. This works fine for my users since they never remove my xll, but even if they did the damage is only one registry entry (or two, I don't remember exactly). I'm planning on refactoring my excelDNA xll and will try to upgrade to .29 to make use of Govert's improvements. Will update this thread with my findings when I do.
Serge