Re: Terminate a running dll



"aaa" <aaa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:067C1573-7368-4F05-82FA-8B6D903D56CD@xxxxxxxxxxxxxxxx
>I have seen TerminateProcess being used when you want to kill a process,
>but
> I've also seen that it is not recommended to use TerminateProcess. (I have
> tried to use TerminateProcess, but it seems that the compiler can't find
> any
> function with that name).
> I have also seen solutions using SendMessage and passing WM_QUIT, however
> then I guess you need to have a window open working together with the
> process. I have a COM dll which has no attached window. Which is the best
> way
> to close it? If it is TerminateProcess - how can I make that work?

A DLL should "die" on its own when the last reference is released. If it's
staying in ram, there's probably something wrong inside somewhere. Most
likely a circular reference.

ActiveX Component Standards and Guidelines
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconolecomponentstandardsguidelines.asp

ActiveX Component Shutdown
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconolecomponentshutdown.asp

Visual Basic Component Shutdown Rules
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconvisualbasiccomponentshutdownrules.asp


--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..


.


Loading