0

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?

4

1 回答 1

1

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.

于 2009-01-18T23:59:33.940 回答