here's a little tutorial how to launch an external .exe
It needs no caps.
1. add following libs to your pro
LIBS += -lapparc -lapgrfx
2. include this headers
#include <apacmdln.h>
#include <apgcli.h>
3. use this simple code to launch an app:
CApaCommandLine* commandLine = CApaCommandLine::NewLC();
commandLine->SetCommandL(EApaCommandRun);
commandLine->SetExecutableNameL(_L("myapp.exe"));
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
User::LeaveIfError(apaLsSession.StartApp(*commandLine));
CleanupStack::PopAndDestroy(&apaLsSession);
CleanupStack::PopAndDestroy(commandLine);
you can also use it dynamically (works from Qt and native code):
void launch(const QString &n) const {
TPtrC exe(reinterpret_cast<const TText*>(n.constData()));
launch(exe);
}
void launch(const TPtrC &exe) const {
CApaCommandLine* commandLine = CApaCommandLine::NewLC();
commandLine->SetCommandL(EApaCommandRun);
commandLine->SetExecutableNameL(exe);
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
User::LeaveIfError(apaLsSession.StartApp(*commandLine));
CleanupStack::PopAndDestroy(&apaLsSession);
CleanupStack::PopAndDestroy(commandLine);
}