views:

101

answers:

1

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?

+1  A: 

I don't know of any way to do this. If you really need functionalty that cannot be unloaded while VS is running, you should write a package instead of an add-in.

Darren Stokes
Thanks for the info! I haven't used Visual Studio SDK before but I'll look into this option...
PolyThinker