Discussion Board

Results 1 to 11 of 11
  1. #1
    Nokia Developer Champion xhsoldier's Avatar
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190
    start the console app from the UI app.
    when the UI app is exit or crash, the console is still running.

    how?

  2. #2
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Hi,

    May this code will help you

    Code:
    TBuf<50> KMyAppName = _L("MYEXE.EXE");
    			     
    			     CompleteWithAppPath(KMyAppName);
    			     EikDll::StartExeL(KMyAppName);
    Regards,
    Peter

  3. #3
    Nokia Developer Champion xhsoldier's Avatar
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190
    Quote Originally Posted by peter_k_john View Post
    Hi,

    May this code will help you

    Code:
    TBuf<50> KMyAppName = _L("MYEXE.EXE");
    			     
    			     CompleteWithAppPath(KMyAppName);
    			     EikDll::StartExeL(KMyAppName);
    Regards,
    Peter
    it is discarded in symbian os now.

  4. #4
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Hi

    Any way For 2nd edition the above code works fine for me.

    and for 3rd edition i am using this code

    Code:
    RProcess server;
            server.Create(_L("\\sys\\bin\\myexe.exe"), KNullDesC);		
            server.Resume();
    Regards,
    Peter

  5. #5
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Code:
    TInt RunExeL( const TDesC& aExeName)
    {
    	TPtrC exePtr;
    	exePtr.Set(aExeName);
    	if (exePtr != KNullDesC())
    	{
    		RApaLsSession apaLsSession;
    		TInt err = apaLsSession.Connect();
    		if (err != KErrNone)
    		{
    			return err;
    		}
    		else
    		{
    			CleanupClosePushL(apaLsSession);  // push apaLsSession
    			CApaCommandLine* cmd = CApaCommandLine::NewLC();  // push cmd
    	
    			cmd->SetExecutableNameL(exePtr);
    			
    			cmd->SetCommandL(EApaCommandOpen);
    			err = apaLsSession.StartApp(*cmd);
    			if (err != KErrNone)
    			{
    				return err
    			}
    			CleanupStack::PopAndDestroy(cmd);  // pop cmd
    			CleanupStack::PopAndDestroy();  // pop apaLsSession
    		}
    	}
    }

  6. #6
    Nokia Developer Champion xhsoldier's Avatar
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190
    it seems that when the ui app exit, the console is exited.
    but I do not want my console exit when ui exit.

    how
    Quote Originally Posted by skumar_rao View Post
    Code:
    TInt RunExeL( const TDesC& aExeName)
    {
    	TPtrC exePtr;
    	exePtr.Set(aExeName);
    	if (exePtr != KNullDesC())
    	{
    		RApaLsSession apaLsSession;
    		TInt err = apaLsSession.Connect();
    		if (err != KErrNone)
    		{
    			return err;
    		}
    		else
    		{
    			CleanupClosePushL(apaLsSession);  // push apaLsSession
    			CApaCommandLine* cmd = CApaCommandLine::NewLC();  // push cmd
    	
    			cmd->SetExecutableNameL(exePtr);
    			
    			cmd->SetCommandL(EApaCommandOpen);
    			err = apaLsSession.StartApp(*cmd);
    			if (err != KErrNone)
    			{
    				return err
    			}
    			CleanupStack::PopAndDestroy(cmd);  // pop cmd
    			CleanupStack::PopAndDestroy();  // pop apaLsSession
    		}
    	}
    }

  7. #7
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Did you Tried It must Not Exit.

  8. #8
    Nokia Developer Champion xhsoldier's Avatar
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190
    Quote Originally Posted by skumar_rao View Post
    Did you Tried It must Not Exit.
    trying now, but how about RProcess?

  9. #9
    Nokia Developer Champion xhsoldier's Avatar
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190
    RApaLsSession aSession;
    aSession.Connect();
    CApaCommandLine* aCmd = CApaCommandLine::NewL();

    aCmd->SetExecutableNameL(_L("S60exe.exe"));
    aCmd->SetCommandL( EApaCommandRunWithoutViews );
    aSession.StartApp(*aCmd);
    /*
    aCmd->SetExecutableNameL(_L("myexe.exe"));
    aCmd->SetCommandL( EApaCommandOpen );
    aSession.StartApp(*aCmd);
    */
    aSession.Close();
    delete aCmd;

    works.
    thanks

  10. #10
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Quote Originally Posted by xhsoldier View Post
    trying now, but how about RProcess?
    RProcess Req. All Files Capability.

  11. #11
    Super Contributor peter_k_john's Avatar
    Join Date
    Oct 2005
    Posts
    739
    Quote Originally Posted by skumar_rao View Post
    RProcess Req. All Files Capability.
    Hi,

    It doesn't need any special capability.

    look at this thread for your clarification. http://newlc.com/topic-18599 and more over I have tried that in my application too.

    Regards,
    Peter

Similar Threads

  1. GetErrorText in console app
    By rihoe in forum Symbian C++
    Replies: 7
    Last Post: 2009-02-05, 11:02
  2. Replies: 2
    Last Post: 2007-04-25, 09:52
  3. exe app to auto start (2ed)
    By shadow-2005 in forum Symbian C++
    Replies: 4
    Last Post: 2007-03-27, 10:04
  4. symbian signed testing problem.
    By anglina in forum Symbian C++
    Replies: 0
    Last Post: 2007-02-01, 10:15
  5. Replies: 0
    Last Post: 2006-05-18, 16:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved