//
you're reading...
C++, Source Code, Symbian

Symbian – Launch an application with UID

I had been working on Symbian application development for quite some time now and this was the first code snippet I had written.

RApaLsSession apaLsSession;
TInt err = apaLsSession.Connect();
if(err == KErrNone)
{
CleanupClosePushL(apaLsSession);

TApaAppInfo appInfo;
TUid aAppUid; // UId of the application to be launched
TInt retVal = apaLsSession.GetAppInfo(appInfo, aAppUid);

if(retVal == KErrNone)
{
CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
cmdLine->SetExecutableNameL(appInfo.iFullName);
cmdLine->SetCommandL(EApaCommandRun);
User::LeaveIfError( apaLsSession.StartApp(*cmdLine) );

CleanupStack::PopAndDestroy(cmdLine);
}
else
{
// application cannot be launched
}
CleanupStack::PopAndDestroy(&apaLsSession);
}
else
{
// unable to create a session
}
Advertisements

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: