Read-only archive of the All About Symbian forum (2001–2013) · About this archive

TApaTask not works in *.exe. How it resolve?

1 replies · 3,137 views · Started 08 June 2004

Hi,
The second code works only in *.app files, but not works in *.exe files:

_LIT(filen,"Calcsoft.app"😉;
const TUid KUidApplicationWillRun = {0x10005902};
const TUid KUidApplicationWasRun = {0x0DB454A8};
....
RApaLsSession ls;
User::LeaveIfError(ls.Connect());
CleanupClosePushL(ls);
TThreadId dummy;
TApaTaskList tasklist(CCoeEnv::Static()->WsSession());
TApaTask task(tasklist.FindApp(KUidApplicationWasRun)); // bad line!!!
if(task.Exists())User::LeaveIfError(ls.StartDocument(filen,KUidApplicationWillRun,dummy));

When i'm run this code which in exe file shown error: KERN_EXEC 3
How can resolve this problem, that it works in *.exe?
Thanks in advance!!!

Hi,
Try this code:


RProcess server;
CleanupClosePushL(server);
User::LeaveIfError((_L("path to your .exe application"😉, _L(""😉));
server.Resume();
CleanupStack::PopAndDestroy(); // server