Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

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

From 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.
62 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.

×