Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unloading COM DLL for outlook addin

Status
Not open for further replies.

Jcan

Programmer
Jul 16, 2001
25
US
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

Jcan
 
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...
 
Thank you for your help. it works great !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top