Results 1 to 1 of 1

Thread: How to use QProcess in WinCE?

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default How to use QProcess in WinCE?

    Hi All,

    I tried to execute another program from my program using QProcess in WinCE. But I got the Unknown Error.
    Please kindly show me the way how to use it.

    Code:
    ****************************************

    void MyWidget::runProcess()
    {
    proc = new QProcess();
    proc->start("\Program Files\AnotherProg\anotherProg.exe",QIODevice::NotO pen);
    // proc->start("//Program Files//AnotherProg//anotherProg.exe",QIODevice::NotOpen);
    // If I add QIODevice::ReadWrite, there is no response (no error also).
    QObject::connect(proc,SIGNAL(finished(int,QProcess ::ExitStatus)),this,SLOT(finishedProcess(int,QProc ess::ExitStatus))); QObject::connect(proc,SIGNAL(error(QProcess::Proce ssError)),this,SLOT(errorProcess(QProcess::Process Error)));
    }

    void MyWidget::closeProcess()
    {
    if(proc->isOpen())
    proc->close();
    }

    void MyWidget::finishedProcess(int i , QProcess::ExitStatus status)
    {
    if(status == QProcess::CrashExit)
    {
    QMessageBox::information(this,"Warning","Problem occurred during process");
    }
    }
    void MyWidget::errorProcess(QProcess::ProcessError errorStatus)
    {
    switch (errorStatus)
    {
    case QProcess::FailedToStart:
    {
    QMessageBox::information(this,"Error","FailedToSta rt" + proc->errorString());
    }break;
    case QProcess::Crashed:
    {
    QMessageBox::information(this,"Error","Crashed" + proc->errorString());
    }break;
    case QProcess::Timedout:
    {
    QMessageBox::information(this,"Error","Timedout" + proc->errorString());
    }break;
    case QProcess::ReadError:
    {
    QMessageBox::information(this,"Error","ReadError" + proc->errorString());
    }break;
    case QProcess::WriteError:
    {
    QMessageBox::information(this,"Error","WriteError" + proc->errorString());
    }break;
    case QProcess::UnknownError:
    {
    QMessageBox::information(this,"Error","UnknownErro r" + proc->errorString());
    }break;
    }
    }

    ****************************************
    And please teach me good way to use QProcess.
    Thanks for your time,
    Lwin
    Last edited by lwinhtooko; 2nd September 2010 at 10:15.

Similar Threads

  1. Replies: 0
    Last Post: 26th August 2010, 10:44
  2. wince project doesn't work on wince, but works on win mobile
    By thedimitrius in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th March 2010, 12:01
  3. All features on WinCE
    By Jef Patat in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 6th January 2010, 17:50
  4. WINCE app can not run
    By baby911 in forum Qt for Embedded and Mobile
    Replies: 10
    Last Post: 28th July 2009, 04:06
  5. QtUiTools for WinCE ?
    By Gilles.Bordas in forum Installation and Deployment
    Replies: 1
    Last Post: 6th July 2008, 18:26

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.