Hello,
I want to start a process from my software. Here is the code that I used:
bool MainForm::ProcessStart()
{
try
{
programProcess>setWorkingDirectory("c:\\");
arguments << "-foo " << bar;
programProcess>start("c:\\foobar.exe");
return true;
}
catch (int e)
{
return false;
}
}
void MainForm::ProgramStart()
{
if (!ProcessStart())
{
"<p>Foobar.exe cannot opened</p>"));
}
}
bool MainForm::ProcessStart()
{
try
{
QProcess *programProcess = new QProcess();
programProcess>setWorkingDirectory("c:\\");
QStringList arguments;
arguments << "-foo " << bar;
programProcess>start("c:\\foobar.exe");
return true;
}
catch (int e)
{
return false;
}
}
void MainForm::ProgramStart()
{
if (!ProcessStart())
{
QMessageBox::critical(this, QString::fromUtf8("Process foo cannot started!"),
QString::fromUtf8(
"<p>Foobar.exe cannot opened</p>"));
}
}
To copy to clipboard, switch view to plain text mode
But the process didnt started. Whats the problem? Where's my wrong?
Bookmarks