[Qt-interest] QProcess::start() fails with win32 paths

Stephen Collyer scollyer at netspinner.co.uk
Mon Apr 6 23:03:43 CEST 2009


I have some code that does this:

    QString command = QCoreApplication::applicationDirPath() +
"/protocol_manager_exe";
#ifdef Q_OS_WIN
    command += ".exe";
#endif

..

    QProcess* proc = new QProcess();
    proc->setEnvironment(env);
    proc->start(command);

When command contains:

C:/Program Files/MDP 1.0.0/MDP_1.0.0/bin/protocol_manager_exe.exe

it fails to start the external process with an QProcess::error() of 0.

When I put the same process in c: so that command contains:

c:/protocol_manager_exe.exe

then the process starts correctly. This behaviour seems to be identical
between Qt 4.4 and Qt 4.5

Can anyone suggest what the problem is here ?

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090406/357a045d/attachment.html 


More information about the Qt-interest-old mailing list