When I try to unload my VB plugin with the PostMessage method (MessengerPlus_PluginChange), I'm not allowed to replace the DLL file because it says 'Access Denied'. MsgPlus! actually unloads it (the Uninitilalize and Class_Terminate functions are called in the plugin) but it still cannot be replaced.
I've tried a call to CoFreeUnusedLibraries() API after the PostMessage, but it has no effects on the problem. Also, I've tried CoUninitialize() in the Uninitialize function, but then MSN won't even start. When used in Class_Terminate of the Main class, it has no effects at all.
EDIT: I've tried OleUninitialize instead of CoUninitialize, it unlocks the DLL but also closes MSN.
There were some discussion on this subject
here, but no solutions were pointed out.
Since it seems to happen with VB DLLs only, it may be a MsgPlus! bug. The workaround is to close MSN, replace the DLL and restart it, but it's not user-friendly.
Any ideas?