×
Namespaces

Variants
Actions

Archived:How to launch an Exe and pass command line arguments

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
CompatibilityArticle
Created: User:Kanu123 (27 Jun 2007)
Last edited: pavarang (18 Feb 2013)


Headers required:

#include <f32file.h>
#include <apgcli.h>
#include <apacmdln.h>

Library needed:

LIBRARY efsrv.lib
LIBRARY apgrfx.lib
LIBRARY apparc.lib

Source:

_LIT(KAppPath, "c:\\system\\apps\\appname\\myapp.app");
_LIT(KParameters, "somearguments");
 
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);
TFindFile file(fs);
User::LeaveIfError(file.FindByDir(KAppPath,KNullDesC));
 
RApaLsSession ls;
User::LeaveIfError(ls.Connect());
CleanupClosePushL(ls);
CApaCommandLine *cmd = CApaCommandLine::NewLC();
cmd->SetLibraryNameL(file.File());
// Passing parameters //
cmd->SetTailEndL(KParameters);
cmd->SetCommandL(EApaCommandRun);
User::LeaveIfError(ls.StartApp(*cmd));
 
CleanupStack::PopAndDestroy(3);

Internal Links:

This page was last modified on 18 February 2013, at 12:01.
57 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×