Results 1 to 3 of 3

Thread: QProcess start a console program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Aug 2006
    Posts
    44
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProcess start a console program

    Just because the program has 'started' doesn't mean the shared memory has been set up yet. I haven't looked at the details of QProcess' implementation, but it seems like a more robust solution for you here would be to:

    1) start process and determine that the launch was successful
    2) attempt for some period of time via a polling loop to connect to the shared memory

    You should have a reasonable notion of how long client.exe takes to set up its shared memory in most cases. Since you're dealing w/ interprocess communication here, on a shared resource, assuming that any specific time will always be enough is less than optimal. I'd suggest having a 'timeout' parameter, and if you fail to be able to connect to the shared memory after that amount of time, give up.

  2. The following user says thank you to Eldritch for this useful post:

    Shawn (9th November 2007)

Similar Threads

  1. I start a external fortram program, how to terminate?
    By dolphins in forum Qt Programming
    Replies: 3
    Last Post: 28th October 2007, 13:07
  2. QProcess and console programs
    By bond_e in forum Qt Programming
    Replies: 10
    Last Post: 13th July 2007, 08:39
  3. Questions about kill() and start() of QProcess
    By mp33919 in forum Qt Programming
    Replies: 5
    Last Post: 23rd June 2007, 13:00
  4. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  5. How to run a console program "silently"?
    By fullmetalcoder in forum Qt Programming
    Replies: 9
    Last Post: 23rd July 2006, 10:03

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.