Tech Support > Microsoft Windows > Development Resources > Force unload of out of process COM object
Force unload of out of process COM object
Posted by Rik Smithies on August 4th, 2004


What techniques are there to force an out of process COM exe to unload
when its client application has ended suddenly ? The reference count
is obviously not getting decremented.

If my client app (C++/MFC) crashes or gets killed it leaves its COM
servers (C++/ATL) running.

Can the COM objects detect orpaned connections ? Can an external
process find these ?

thanks
Rik

Posted by Patrick Philippot on August 4th, 2004


Rik Smithies wrote:
It actually does. If the server is remote, DCOM has always used a ping
mechanism to detect a dead client. So the server will terminate
automatically. If the server is local, the same mechanism works with LPC
at least since Win2k, if I'm correct. The server process will terminate
after about 6-7 minutes. Just be patient :-) . A ping is sent every two
minutes and the reference count is decremented if 3 or more ping periods
elapse without the server receiving an answer.

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr




Similar Posts