devx
25th November 2009, 14:40
Im using QProcess (Qt 4.5) to access console (cmd.exe ) in Windows XP.
Is has properly connected stdout/stderr/terminate signals.
When i send something to its write channel it seems to work correctly. CMD responds as it sholud (for ex: dir command,). Im able to read output from stdout channel (result: directory list).
The problem is when i send some garbage (for ex "aksfvakhv"). Console program sends proper stderr output text ("Command not found" or something) and then it terminates! So I need to restart it again. I tried it with another console program and it behaves the same way.
Im using readAllStandardError() to do read stderr channel.
Process sends terminate signal (ExitStatus: NormalExit).
void JGI::readStdError()
{
QByteArray errbuffer=cmdProc->readAllStandardError();
ui->cmdStdError->setText(QString::fromLocal8Bit(errbuffer));
}
Whats wrong?
Signals are connected properly. Checked n times.
Is has properly connected stdout/stderr/terminate signals.
When i send something to its write channel it seems to work correctly. CMD responds as it sholud (for ex: dir command,). Im able to read output from stdout channel (result: directory list).
The problem is when i send some garbage (for ex "aksfvakhv"). Console program sends proper stderr output text ("Command not found" or something) and then it terminates! So I need to restart it again. I tried it with another console program and it behaves the same way.
Im using readAllStandardError() to do read stderr channel.
Process sends terminate signal (ExitStatus: NormalExit).
void JGI::readStdError()
{
QByteArray errbuffer=cmdProc->readAllStandardError();
ui->cmdStdError->setText(QString::fromLocal8Bit(errbuffer));
}
Whats wrong?
Signals are connected properly. Checked n times.