You Are Here:

Community: Wiki

This page was last modified on 3 September 2009, at 18:43.

How to Launch an EXE and Pass Command Line Arguments

From Forum Nokia Wiki

Reviewer Approved   

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:

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia