I have a Windows QT application and I'm trying to open an external game, but I did not get success. / P>
The application is in C: \ games \ Oni \ Edition \ and which is called Oni.exe, the code I am currently using is followed:
zero Main window:: On_toolButton_clicked () {qint64 test = 1; If (! QProcess :: startDetached ("Oni.exe", QStringList (), "C: \\ Games \\One \\ version \\", & amp; test)) {QMessageBox msgBox; MsgBox.setText ("Can not start onny cole!"); MsgBox.exec (); }} I do not know if I am missing something? If I double click it then the game runs fine. Thank you.
OK, put it
The bus code has been changed:
QProcess :: startDetached ("Oni.exe", QStringList (), "C: \\ Games \\Onie \\ Version \\ ", & amp; test) by QProcess :: startDetached (" C: \\ Games \\One \\ version \ \ Oni.exe ", QStringList ()," C: \\ Games \\One \\ version \\ ", & amp; test) And it works like a charm
I also have QProcess :: startDetached ("C: \\ games \\ Oni \\ version \\ Oni.exe"); Before but did not work, it seems that we should always keep the complete directory of the executable and the work directory as a complete directory. This seems to cause the file to be executed directly, when it is in the game folder, then the file is automatically searching for another folder / files in the QT debug folder. Before the game ends prematurely. :) Using another solution will be the original API of the user at user 8279 9 as the URL:
This latter solution should also work well with UAC problems .
Comments
Post a Comment