×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    19

    Unhappy How to kill QProcess by pID

    Hi all,

    Need to run and kill the process alternatively while pressing the command.
    When i press the command again i need to kill the process, but it wont.
    I started run the process using the following line
    static const pid = 0;
    QProcess* ps;
    QStringList ls;
    ps->startDetached("C:\\sys\\bin\\Test.exe",ls,"",&pid);
    When i trying to kill the process it wont.
    ps->kill();
    I tried to stop the running process using close(), terminate() and kill(), but it seems to be not stopped and closing. I am using Qt 4.7.
    I checked the process Id (pID) for the process which i am running. It shows the same processid for the every process which i am running again and again.It does not seems to be killed or stopped.
    May i know how to kill the process.
    Waiting for reply.

    Regards
    Santhosh

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: How to kill QProcess by pID

    usually it is not a good idea to kill any other application. you might want to send a message / command to terminate it self.

    Also if you are trying on a device you might need Proper capabilities to KILL a process.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    19

    Re: How to kill QProcess by pID

    Hi rao,
    Thanks for replying me..
    May i know how to send a message/ command to terminate the QProcess by itself. will u please provide me some example.

    Regards
    Santhosh.

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: How to kill QProcess by pID

    you can search in wiki for inter process communication one of the common one i use is this http://wiki.forum.nokia.com/index.ph...6_QLocalServer

Similar Threads

  1. How to kill a sprite?
    By phil_mw60 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2010-04-25, 21:44
  2. How to kill a process ? I can kill tasks, but...
    By protochip in forum Symbian
    Replies: 2
    Last Post: 2008-10-23, 14:05
  3. Replies: 6
    Last Post: 2008-08-31, 10:30
  4. How to kill a thread?
    By carknue in forum Symbian
    Replies: 6
    Last Post: 2008-03-30, 22:12

Posting Permissions

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