Hello everyone,
can anyone tell me how to shutdown a COM addin created for outlook? Even after exiting the Outlook app. the Addin is still in memory.
Thanks
If You load a DLL/OCX in Your Program, You should first check with GetModuleHandle(), if the Library is loaded. You should use FreeLibrary(), if You do not need it more. But if a Library loads another Libraries, it may not work. If it is so, You should find out (with Debugger, for example) these Libraries and unload they before You unloads Your DLL.
If a Library was loaded with another Process,only the process can unload it (You can Yse CreateRemoteThread() to avoid this Problem).
It may be, that another Application or driver uses (or think so) the DLL, and the System lets the Dll loaded. If another Process has used the DLL, it should free it too.
You can try to play with FreeLibraryAndExitThread() and DisableThreadLibraryCalls().
If a dll has/creates static thread local storages, it may be a Problem too.
A Library can contain not frred or used from another Processes Resources.
COM have some Errors too.
And so on...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.