×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    119

    Can't kill process when console is enabled

    Hello,

    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:

    Code:
    	while(finder.Next(name) == KErrNone) 
    	{
    		// check if this is our process 
    		if(name.FindF(KProcessName) != KErrNotFound) 
    		{
    			RProcess process;
    			if(process.Open(finder, EOwnerProcess) == KErrNone) // Open process
    			{
    				process.Kill(KErrNone);  // Kill process
    				process.Close();
    			}
    		}
    	}
    Using this code I can stop the deamon from a GUI application.

    Then, I create a console inside the deamon:

    Code:
    LOCAL_D CConsoleBase* console;
    [...]
    TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
    And when the console is created I can no longer kill the process, it won't exit...

    I suppose I should kill the console in some way first, but how can I do it?

    Thanks,
    Maciej

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Can't kill process when console is enabled

    Have you checked if TFindProcess finds anything and if RProcess::Open succeeds?

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Can't kill process when console is enabled

    What platform are you working on and why don't you find a nice way of telling the daemon that is time to exit?
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    119

    Re: Can't kill process when console is enabled

    I think the nice way will be to use the RProperty class - now I do realise it isn't very elegant to kill the deamon, in fact I did realise it earlier, but I thought I wouldn't change that just because of debugging issues.

    But it's an interesting issue anyway, isn't it?

    @wizard_hu: I didn't actually, but the only thing I change in the deamon code is enabling the console... Would that change anything in the way that I should search for the process?

Similar Threads

  1. How to kill system process?
    By Svat_ in forum Symbian
    Replies: 9
    Last Post: 2010-10-06, 13:59
  2. RProcess Kill Behaviour Question
    By AlfredoRU in forum Symbian
    Replies: 4
    Last Post: 2008-06-03, 18:11
  3. How to kill a protected process?
    By VinodRaut in forum Symbian
    Replies: 3
    Last Post: 2007-11-13, 06:15
  4. Help! Can't kill process...
    By jetair in forum Symbian
    Replies: 5
    Last Post: 2007-05-07, 09:41
  5. kill exe process
    By ceehira in forum Symbian
    Replies: 6
    Last Post: 2006-08-18, 10:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×