Results 1 to 6 of 6

Thread: QProcess Problem: Program doesnt start

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question QProcess Problem: Program doesnt start

    Hello,

    I want to start a process from my software. Here is the code that I used:
    Qt Code:
    1. bool MainForm::ProcessStart()
    2. {
    3. try
    4. {
    5. QProcess *programProcess = new QProcess();
    6. programProcess>setWorkingDirectory("c:\\");
    7.  
    8. QStringList arguments;
    9. arguments << "-foo " << bar;
    10.  
    11. programProcess>start("c:\\foobar.exe");
    12. return true;
    13. }
    14. catch (int e)
    15. {
    16. return false;
    17. }
    18. }
    19.  
    20. void MainForm::ProgramStart()
    21. {
    22. if (!ProcessStart())
    23. {
    24. QMessageBox::critical(this, QString::fromUtf8("Process foo cannot started!"),
    25. QString::fromUtf8(
    26. "<p>Foobar.exe cannot opened</p>"));
    27. }
    28. }
    To copy to clipboard, switch view to plain text mode 

    But the process didnt started. Whats the problem? Where's my wrong?
    Last edited by musaulker; 29th March 2007 at 22:48. Reason: reformatted to look better

Similar Threads

  1. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  2. Quoting problem with QProcess
    By the_bis in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2006, 11:24
  3. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30
  4. QProcess start automaticaly needed application
    By raphaelf in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 14:11
  5. QProcess problem with windows batch file
    By bood in forum Qt Programming
    Replies: 11
    Last Post: 6th January 2006, 08:08

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.