Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Dllhost process is not terminated after com+ appl has ended

Hi all!

The major part of my client/server dcom app is working now, except for the dllhost processes that are created to host my activex dll server component. Although the application does not generate any error and is removed from the Active Tasks in dcomcnfg (COM+ explorer) as it should, the dllhost.exe process for this particular server app is not being killed (what I would expect).

This would not be the biggest problem, but it eats memory and worse, when shutting down the machine, I get this message 'Shutting down dll.host.exe' with this annoying progressbar and the button 'End now' for every instance of dllhost that the machine has been using for this application.

What can cause this out-of-sync between COM and the task manager? ANd how do I solve this to terminate automatically?

Thanks in advance!

Guido Vrijdag
[893 byte] By [vrijdag] at [2007-11-11 10:13:38]
# 1 Re: Dllhost process is not terminated after com+ appl has ended
maybe your application is not ended, don't show your application in the tasklist doesn't mean essentialy that your application has ended , and in process list too ... maybe still running as service .
the best method to know your problem where, put in your _unload event the END statment ... and hence it may completly close your application saftley or it may show you a "problem with xyz.exe and need to close, end task" box .. and in this case you need to look again into your unload method , maybe u mess to close a connection , to unload a form, class, or a component or any thing similar .
Amahdy at 2007-11-11 17:22:59 >
# 2 Re: Dllhost process is not terminated after com+ appl has ended
Hi Amahdy!

Thank you for your quick response. Unfortunately, I am afraid that I was not clear enough about the task list. I did not mean the task list of Windows, but the one in the COM+ Explorer (dcomcnfg.exe). DLLHost.exe is hosting my activex dll, which is not even allowed to have the END statement. And because it is a dll, it should die whenever no references to any object exist anymore (and I can assure you: there aren't any). So COM+ sees there are no references anymore (correct), but Windows 'refuses' to kill the dllhost.exe, while it is not hosting my dll anymore.

Any ideas?

Guido Vrijdag
vrijdag at 2007-11-11 17:24:02 >
# 3 Re: Dllhost process is not terminated after com+ appl has ended
I'm not sure about this so r u sure that " it should die whenever no references " ? or u must make it die ?
and I don't know really how to make a legal killing for the dllhost, but just about the first topic, put in the class_terminat() a msgbox "I'm goind to die !" , and see if u can see this msgbox when there is no refrence or nop to ensure that it works as u appreciate .
Hope this helps.
Amahdy at 2007-11-11 17:24:59 >