Results 1 to 2 of 2

Thread: Send data to parent process in Qt

  1. #1
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Send data to parent process in Qt

    I have an application where i launched a process (using QProcess) , from this process i need to send a message to parent process.

    from parent

    Qt Code:
    1. int msgid = msgget(0x1234,IPC_CREAT|0666);
    2. char str[50];
    3. qDebug() << "waiting for msg ";
    4. msgrcv(msgid,str,sizeof str,0,0);
    5.  
    6. if (!strcmp(str,"sender")){
    7. /*do some processing */
    8. }
    To copy to clipboard, switch view to plain text mode 

    from the child

    Qt Code:
    1. int msgid = msgget(0x1234,IPC_CREAT|0666);
    2. char str[]="sender";
    3. qDebug() << "sending for msg ";
    4. msgsnd(msgid,str,strlen(str)+1,0);
    To copy to clipboard, switch view to plain text mode 



    i am getting a msg "waiting for msg" and system is going to hang. what is the problem?

    how else will pass msg from one process to other.

    Thanks.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Send data to parent process in Qt

    what does your code have to do with Qt?

    Look at QProcess for reading standard / error output
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Send signal from the parent to the child?
    By hakermania in forum Newbie
    Replies: 6
    Last Post: 8th June 2011, 07:57
  2. How to send SIGINT to a process?
    By SYR in forum Qt Programming
    Replies: 1
    Last Post: 4th March 2011, 08:23
  3. I need to send a message to parent dialog
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2008, 11:16
  4. Send a key to process
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 9th July 2007, 17:37
  5. QProcess : child process listening parent output ?
    By Nyphel in forum Qt Programming
    Replies: 16
    Last Post: 20th March 2007, 13:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.