I'm having problems with killing a deamon exe when it has a console created inside itself. I am using the console for debugging. When there is no console inside the deamon, I use this piece of code in my GUI application and it works fine:
Using this code I can stop the deamon from a GUI application.
while(finder.Next(name) == KErrNone)
// check if this is our process
if(name.FindF(KProcessName) != KErrNotFound)
if(process.Open(finder, EOwnerProcess) == KErrNone) // Open process
process.Kill(KErrNone); // Kill process
Then, I create a console inside the deamon:
And when the console is created I can no longer kill the process, it won't exit...
LOCAL_D CConsoleBase* console;
TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
I suppose I should kill the console in some way first, but how can I do it?