Agroni
14th September 2012, 15:10
I have a batch file (ppp.bat) with only two lines in it:
start .
exit /b 23
The C++ code to call QProcess::start is this:
QString program = "c:\\ppp.bat";
QProcess *myProcess = new QProcess(this);
myProcess->start(program);
myProcess->waitForStarted();
myProcess->waitForFinished(1000);
QString strExitCode( "ExitCode is %1 ExitStatus is %2");
strExitCode = strExitCode.arg( myProcess->exitCode()).arg( (int) myProcess->exitStatus());
ui->textEdit->append( strExitCode);
It always prints 0 for exitCode.
What is needed to have this function return 23?
Oh the OS is Windows XP SP 3 and the Qt is 4.8.1 compiled with VS2010.
Thanks.
start .
exit /b 23
The C++ code to call QProcess::start is this:
QString program = "c:\\ppp.bat";
QProcess *myProcess = new QProcess(this);
myProcess->start(program);
myProcess->waitForStarted();
myProcess->waitForFinished(1000);
QString strExitCode( "ExitCode is %1 ExitStatus is %2");
strExitCode = strExitCode.arg( myProcess->exitCode()).arg( (int) myProcess->exitStatus());
ui->textEdit->append( strExitCode);
It always prints 0 for exitCode.
What is needed to have this function return 23?
Oh the OS is Windows XP SP 3 and the Qt is 4.8.1 compiled with VS2010.
Thanks.