Click to See Complete Forum and Search --> : NT Service


SSP
May 18th, 1999, 09:41 AM
Hi,
I have two exes to accomplish the requirements. EXE1 is a NT Service. It kicks off EXE2 by calling createprocess.(MFC app, which kicks off bunch of EXEs in the similar manner).
But when I stop the service, I TerminateProcess for EXE2. EXE2 is killed but EXE2 doesn't kill the bunch of EXEs mentioned in the destructor of View Class.

But if I kick-off EXE2 and kill it separately, all other EXEs are killed.

Any clue ? Any other way to accomplish killing of child EXEs of EXE2 ?

Your input will be appreciated!

May 31st, 1999, 10:43 AM
Hello!

You should not use TerminateProcess() to close your application because it doesn't allow the process to clean up before terminating (that is the reason your EXEs aren't killed). You should send a message to your EXE to kill itself gracefully (RegisterWindowMessage). TerminateProcess() should be used only to ABORT an application. Hope this help!

Guy Letourneau
Software Engineer
gletourneau@ordinox.com