Hi,
I have problem with support / starting external process.
I have simple console application which adds two entered numbers and display result.
When I run this console application in cmd.exe it works fine - stdin in cmd.exe is directly send
to my application, stdout in my application is directly send to cmd.exe console and when my app exit
stdin return to work with cmd. sample use:
testApp.png
Now question - how i can set QProcess that can work the same way?
what I have:
process.start( "C:/Users/C50/Desktop/test/consoleQt.exe",
while( process.
state() == QProcess::Running ) {
process.write( in.readLine().toStdString().c_str() );
}
QProcess process;
process.start( "C:/Users/C50/Desktop/test/consoleQt.exe",
QStringList(), QIODevice::ReadWrite | QIODevice::Text );
QTextStream in( stdin );
while( process.state() == QProcess::Running ) {
process.write( in.readLine().toStdString().c_str() );
}
To copy to clipboard, switch view to plain text mode
Bookmarks