You Are Here:

Community: Wiki

 

Talk:How to start and stop exe

From Forum Nokia Wiki

How can I pass and get the values from other exe to one...? My sample code is here

main.cpp

==================================

GLDEF_C TInt E32Main()

   {
   // Create cleanup stack
 __UHEAP_MARK;
   CTrapCleanup* cleanup = CTrapCleanup::New();
   // Run application code inside TRAP harness, wait keypress when terminated
   TRAPD(mainError, MainL());
   delete cleanup;
 __UHEAP_MARKEND;
   return KErrNone;
   }

LOCAL_C void MainL() { const TBool& result = LaunchApplication(KExeName); /********************************** How can I get the Return Value from EXE.exe Success Result ***********************************************************/ if(result) {} }

LOCAL_C TBool LaunchApplication(const TDesC& aExeName) { CApaCommandLine* commandLine = CApaCommandLine::NewLC(); // push commandLine

   commandLine->SetCommandL(EApaCommandRun);
   commandLine->SetExecutableNameL(aExecName);
   RApaLsSession apaLsSession;
   User::LeaveIfError(apaLsSession.Connect());
   CleanupClosePushL(apaLsSession);  // push apaLsSession
   User::LeaveIfError(apaLsSession.StartApp(*commandLine));
   CleanupStack::PopAndDestroy();  // pop apaLsSession
   CleanupStack::PopAndDestroy(commandLine);  // pop commandLine

}


exe.cpp

================================

GLDEF_C TInt E32Main()

   {
   // Create cleanup stack
 __UHEAP_MARK;
   CTrapCleanup* cleanup = CTrapCleanup::New();
   // Run application code inside TRAP harness, wait keypress when terminated

TBool& result = EFalse;

   TRAPD(mainError, result = InstallMyAppL());

/********************************************************* Here I wanted to send the result back to application which launched EXE.CPP ************************************************************/

   delete cleanup;
 __UHEAP_MARKEND;
   return KErrNone;
   }
 
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