I'm writing a Visual Studio add-in using C/C++. I am not familiar with the COM architecture. In fact I'm learning Windows programming.
I can see an OnDisconnect() call back into my add-in. I tried returning S_FALSE, but that does not seem to stop the add-in from being unloaded.
So my questions is, is it possible to make an add-in that cannot be unloaded (either through the Tools menu or programatically), and if yes, will some magic return value from OnDisconnect() do the job, or some other trick is required?
I also saw another question that asks exactly the opposite. From the answer, it seems that the DLL still resides in the memory when an add-in is unloaded. So maybe there is a way to reload the add-in as soon as it is unloaded?