PDA

View Full Version : a QProcess thing



jajdoo
23rd March 2011, 12:32
I'm trying to run tasm (turbo assembler compiler) using a QProcess, but I'm having problems..
here's the relavent code:

output_win - a QTextEdit
srcTarget_line - a QLineEdit


bool OMGASM::mainWin::compileSrc()
{
QString program = "TC/BIN/tasm.exe";
QStringList arguments;
arguments <<srcTarget_line->text();

QProcess *p = new QProcess();
p->start(program, arguments);

p->waitForStarted();
p->waitForReadyRead();
p->waitForFinished();

output_win->append( p->errorString() );
output_win->append( p->readAllStandardError() );
output_win->append( p->readAll() );

p->terminate();
delete p;
return true;
}

all i get is "unknown error" on my 'output_win'.. (and it did not compile)

high_flyer
23rd March 2011, 14:22
Without looking deep in to the code the path
"TC/BIN/tasm.exe";
can't be right.

jajdoo
23rd March 2011, 14:58
the TC folder is in the same folder as my EXE, so i think it is..


i cant make my QString convert to something i can use as the argument of QProcess::write() .. how to?

high_flyer
23rd March 2011, 15:05
so i think it is..
No its not.
it should be
"./TC/BIN/tasm.exe";

jajdoo
23rd March 2011, 15:25
No its not.
;

yes it IS
j/k
:p

figured it out anyhow,
i started cmd first, and wrote the command to it
problem was i sent a c_str instead of ascii to cmd.. thanks anyways