当前位置: 首页>>代码示例>>C++>>正文


C++ CApaCommandLine类代码示例

本文整理汇总了C++中CApaCommandLine的典型用法代码示例。如果您正苦于以下问题:C++ CApaCommandLine类的具体用法?C++ CApaCommandLine怎么用?C++ CApaCommandLine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CApaCommandLine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CleanupClosePushL

void CTcAppLauncher::RunL()
	{
	// Fatal error occurred, report
	User::LeaveIfError( iStatus.Int() );

	if( iDismissDialog )
		{
		TKeyEvent event;
		event.iCode = EKeyDevice3;
		RWsSession wsSession;
		User::LeaveIfError( wsSession.Connect() );
		wsSession.SimulateKeyEvent( event );
		wsSession.Close();
		}

	RApaLsSession apparc;
	User::LeaveIfError( apparc.Connect() );
	CleanupClosePushL( apparc );

	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
	cmdLine->SetExecutableNameL( iAppName );
	cmdLine->SetCommandL( EApaCommandRun );

	User::LeaveIfError( apparc.StartApp( *cmdLine ) );
	CleanupStack::PopAndDestroy( 2 );

	// Write log entry
	LOG( _L("[APPLAUNCHER] Client restarted.") );
	delete this;
	}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:30,代码来源:CTcAppLauncher.cpp

示例2: RDEBUG

// ----------------------------------------------------------------------------------------
// CTerminalControlServer::StartProcessByFullNameL
// ----------------------------------------------------------------------------------------
void CTerminalControlServer::StartProcessByFullNameL ( const TDesC8& aName )
{
    RDEBUG("CTerminalControlServer::StartProcessByFullNameL");

    // 8bit to 16bit string
    //
    HBufC* fileNameBuf = HBufC::NewLC( aName.Length() );
    TPtr   fileName(fileNameBuf->Des());
    fileName.Copy( aName );

    // Connect to application architecture server
    //
    RApaLsSession apaLs;
    User::LeaveIfError( apaLs.Connect() );
    CleanupClosePushL( apaLs );

    // Create command line for process
    //
    CApaCommandLine* cmd = CApaCommandLine::NewLC();

    cmd->SetExecutableNameL( fileName );
    cmd->SetDocumentNameL( KNullDesC() );
    cmd->SetCommandL( EApaCommandRun );

    // Start application
    //
    User::LeaveIfError( apaLs.StartApp( *cmd ) );

    CleanupStack::PopAndDestroy( cmd );
    CleanupStack::PopAndDestroy( &apaLs );
    CleanupStack::PopAndDestroy( fileNameBuf );
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:35,代码来源:TerminalControlServer.cpp

示例3: CleanupClosePushL

// ---------------------------------------------------------------------------
// Launches the app server.
// ---------------------------------------------------------------------------
// 
EXPORT_C void RAlfClientBase::LaunchAppL( 
    TUid aAppUid, 
    TUint aServerDifferentiator, 
    TThreadId& aThreadId )
	{
	RApaLsSession apa;
	User::LeaveIfError( apa.Connect() );
	CleanupClosePushL( apa );
	
	TApaAppInfo info;
	User::LeaveIfError( apa.GetAppInfo( info, aAppUid ) );

	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
	cmdLine->SetExecutableNameL( info.iFullName );
	cmdLine->SetServerRequiredL( aServerDifferentiator );
    // Set the command to start the server in background
    cmdLine->SetCommandL( EApaCommandBackground );        

	TRequestStatus status;	
	TInt err = apa.StartApp( *cmdLine, aThreadId, &status );
    
    User::LeaveIfError( err );
    
    User::WaitForRequest(status);
    
    User::LeaveIfError( status.Int() );
    
	CleanupStack::PopAndDestroy( cmdLine );
	CleanupStack::PopAndDestroy( &apa );
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:34,代码来源:alfclientBase.cpp

示例4: TRAPD

/*!
  return always true, and handle the error in ruby.
  error return is "failed with uid:0x12345678" where 0x12345678 is replaced with given uid
*/
bool LaunchFixture::execute(void * objectInstance, QString actionName, QHash<QString, QString> parameters, QString & stdOut)
{
    bool result = true;

    //TasLogger::logger()->debug("> LaunchFixture::execute:" + actionName);

    if(actionName == "launch_with_uid"){
        bool ok;
        QString temp = parameters.value("UID");
        //TasLogger::logger()->debug("> LaunchFixture::UID: '" + temp + "'");
        TUint uid_i = temp.toUInt(&ok, 0);
        //TasLogger::logger()->debug("  ok: " + QString::number(ok) + " uid: " + QString::number(uid_i));
        TUid uid = TUid::Uid(uid_i);
        //T R A P D starts
        TRAPD(trapErr,
            RApaLsSession session;
            TInt err = session.Connect();
            User::LeaveIfError(err);
            //TasLogger::logger()->debug("  session " );

            CleanupClosePushL(session);
            TApaAppInfo info;
            err = session.GetAppInfo(info,uid);
            User::LeaveIfError(err);
            //TasLogger::logger()->debug("  appinfo " );

            CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
            cmdLine->SetExecutableNameL(info.iFullName);
            cmdLine->SetCommandL(EApaCommandRun);
            User::LeaveIfError(session.StartApp(*cmdLine));
            //TasLogger::logger()->debug("  command line " );
            stdOut.append(QString((QChar*) info.iFullName.Ptr(), info.iFullName.Length()));
            CleanupStack::PopAndDestroy(2);
        );
开发者ID:d0b3rm4n,项目名称:agent_qt,代码行数:38,代码来源:launchfixture.cpp

示例5: OpenFileBySystem

bool OpenFileBySystem(C_application_base &app, const wchar *filename, dword app_uid){

   Cstr_w full_path;
   C_file::GetFullPath(filename, full_path);
   TPtrC fn((word*)(const wchar*)full_path);

   int err = 0;
   {
      RApaLsSession ls;
      ls.Connect();
#if !defined __SYMBIAN_3RD__
      //if(!app_uid)
      {
         TThreadId tid;
         err = 1;
         if(!app_uid){
            TRAPD(te, err = ls.StartDocument(fn, tid));
         }else{
            TUid uid;
            uid.iUid = app_uid;
            TRAPD(te, err = ls.StartDocument(fn, uid, tid));
         }
      }//else
//#endif
#else
      {
         TUid uid;
         if(app_uid){
            uid.iUid = app_uid;
            err = 0;
         }else{
#if defined __SYMBIAN_3RD__
            TDataType dt;
            err = ls.AppForDocument(fn, uid, dt);
#endif
         }
         if(!err){
            TApaAppInfo ai;
            err = ls.GetAppInfo(ai, uid);
            if(!err){
               //User::Panic(ai.iFullName, 0);
               CApaCommandLine *cmd = CApaCommandLine::NewL();
#ifdef __SYMBIAN_3RD__
               cmd->SetExecutableNameL(ai.iFullName);
#else
               cmd->SetLibraryNameL(ai.iFullName);
#endif
               cmd->SetDocumentNameL(fn);
               cmd->SetCommandL(EApaCommandOpen);
               err = ls.StartApp(*cmd);
               delete cmd;
            }
         }
      }
#endif
      ls.Close();
   }
   return (!err);
}
开发者ID:turbanoff,项目名称:X-plore,代码行数:59,代码来源:System.cpp

示例6: AppLaunchedL

/**
The function is used to launch an application using full file name as param.
*/
TInt CTRuleBasedLaunchingStep::AppLaunchedL(RApaLsSession& aLs, const TDesC& aAppFullFileName)
	{	
	CApaCommandLine* cmdLn = CApaCommandLine::NewLC();     
	cmdLn->SetExecutableNameL(aAppFullFileName);
	TInt result = aLs.StartApp(*cmdLn);
	//Wait 0.5sec for App to start
	User::After(500000);
	CleanupStack::PopAndDestroy(cmdLn);
	return result;
	}
开发者ID:fedor4ever,项目名称:default,代码行数:13,代码来源:T_RuleBasedLaunchingStep.cpp

示例7: LS

void applistModel::ExecuteAction(QVariant variant)
{
    LS("applistModel::ExecuteAction =>>");
    QString fullName = variant.toString();

    CApaCommandLine* cmdLine = CApaCommandLine::NewL();
    TBuf<256> fn(fullName.utf16());
    cmdLine->SetExecutableNameL(fn);
    cmdLine->SetCommandL(EApaCommandRun);
    //TODO: StartApp returns faillure code. handle it to show error
    m_session.StartApp(*cmdLine);
    delete cmdLine;

    LS("applistModel::ExecuteAction <<");
}
开发者ID:kcsomisetty,项目名称:powersearch_symbian,代码行数:15,代码来源:applistmodel.cpp

示例8: ProcessCommandParametersL

/** Process command parameters */
TBool CGLPlanetsAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
	{
	TPtrC backgroundColor = aCommandLine.ExecutableName();
	iGLPlanets = CGLPlanets::NewL(iAppView->Window(), backgroundColor, this, KParentQueueName());
	iGLPlanets->Start();
	return CEikAppUi::ProcessCommandParametersL(aCommandLine);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:8,代码来源:glplanetsapp.cpp

示例9: ProcessCommandParametersL

/** Process command parameters */
TBool CMultipleSurfacesAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
	{
	TPtrC childQueueName = aCommandLine.ExecutableName();	
	iMultipleSurfaces = CMultipleSurfaces::NewL(CCoeEnv::Static()->WsSession(),
	        CCoeEnv::Static()->RootWin(), childQueueName, this, KParentQueueName());
	iMultipleSurfaces->Start();
	return CEikAppUi::ProcessCommandParametersL(aCommandLine);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:9,代码来源:multiplesurfacesapp.cpp

示例10: ASSERT

void RAlfClientBase::StartAsyncL(TRequestStatus* aStatus)
    {
    ASSERT(iApa==0 && iCmdLine == 0);
    // Start the server application
    TName serverName;
    TUint differentiator( 0 );
    
    differentiator = KAlfAppServerInterfaceUid3;
    ConstructServerName( 
        serverName, 
        TUid::Uid(KAlfAppServerInterfaceUid3) , 
        differentiator );
    
    TFindServer serverFinder(serverName);
    TFullName fullName;
    if (serverFinder.Next(fullName) == KErrNone)
        {
        User::Leave(KErrAlreadyExists);
        }
        
    TThreadId threadId;
    // we don't have proper destructor and thus we don't take
    // "normal" ownership on our members...
    
    // assign to member after poping from cleanup stack - codescanner now happy
  RApaLsSession*  apa = new (ELeave) RApaLsSession;
	CleanupStack::PushL(apa);
	User::LeaveIfError( apa->Connect() );
	CleanupClosePushL( *apa );
	
	TApaAppInfo info;
	User::LeaveIfError( apa->GetAppInfo( info, TUid::Uid(KAlfAppServerInterfaceUid3) ) );

	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
	cmdLine->SetExecutableNameL( info.iFullName );
	cmdLine->SetServerRequiredL( differentiator );
    // Set the command to start the server in background
    cmdLine->SetCommandL( EApaCommandBackground );        

	User::LeaveIfError(apa->StartApp( *cmdLine, threadId, aStatus ));

    CleanupStack::Pop(3);
    iCmdLine=cmdLine;
    iApa = apa;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:45,代码来源:alfclientBase.cpp

示例11: threadId

TInt RTestApaLsSession::TestExeRecognizerL(const CApaCommandLine& aCommandLine)
	{
	TThreadId dummyThreadId;
	TPckg<TThreadId> threadId(dummyThreadId);
	const TInt opcode=EAppListServStartAppWithoutReturningThreadId;
	TIpcArgs ipcArgs;
	aCommandLine.GetIpcArgsLC(ipcArgs);
	ipcArgs.Set(CApaCommandLine::EIpcFirstFreeSlot, &threadId);
	User::LeaveIfError(SendReceive(opcode, ipcArgs));
	CleanupStack::PopAndDestroy(); // the TIpcArgs
	return KErrNone;
	}
开发者ID:fedor4ever,项目名称:default,代码行数:12,代码来源:t_largestackstep.cpp

示例12: SetupCommandLineL

/** 
Set up the CApaCommandLine object which will be used to start the app.
*/
void CApaAppStart::SetupCommandLineL(CApaCommandLine& aCmdLine,
					const TDesC& aFileName,
					const TDesC8& aArgs,
					TBool aViewLess,
					TBool aStartInBackground)
	{
	
	aCmdLine.SetExecutableNameL(aFileName);
	aCmdLine.SetTailEndL(aArgs) ;
	
	// Define how the app will be launched 		
	if (!aStartInBackground && !aViewLess)
		{
		aCmdLine.SetCommandL(EApaCommandRun);
		}
	else if (aStartInBackground && !aViewLess)
		{
		aCmdLine.SetCommandL(EApaCommandBackground);
		}
	else if (!aStartInBackground && aViewLess)
		{
		aCmdLine.SetCommandL(EApaCommandRunWithoutViews);
		}
	else 
		{
		aCmdLine.SetCommandL(EApaCommandBackgroundAndWithoutViews);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:31,代码来源:apstart.cpp

示例13: _LIT

/**
   @SYMTestCaseID UIF-TCone7Step-TestWindowPositionL
  
   @SYMDEF PDEF109812: Draw optimization assumes children's position are relative to parent's 
  
   @SYMTestCaseDesc Launches the twindowposition application.
	The application test for position of the non window owning control being drawn.
	
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions : Launches an test application as follows.
	Instantiates a CApaCommandLine object. Creates the application KAppFileName using RProcess object
	and sets the process environment. Resumes the process and tests for application's exit reason. 
	The test application draw the controls such that when the child has a parent window and is not 
	relative to the the parent control's window.
	  
   @SYMTestExpectedResults The test application should be started without any error. 
	The test application exit with KErrNone if the position of the child window being drawn matches 
	with co-ordinate space of the parent control. Otherwise it exit with KErrWindowPosDoesNotMatch.

   @SYMTestType : CIT 
 */
TBool CCone7TestAppUi::TestWindowPositionL()
	{
	_LIT(KAppFileName,"z:\\sys\\bin\\twindowposition.exe");
	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();	
	RProcess windowPos;
	TInt ret = windowPos.Create(KAppFileName,KNullDesC);
	TEST(ret == KErrNone);
	User::LeaveIfError(ret);
	CleanupClosePushL(windowPos);
	INFO_PRINTF1(_L("Create twindowposition process."));
	
	//attach commandline to twindowposition process
	TRAP(ret,cmdLine->SetProcessEnvironmentL(windowPos));
	TEST(ret == KErrNone);
	windowPos.Resume();
	//Time for the twindowposition process to launch itself
	User::After(3000000);
	TEST(windowPos.ExitReason() != KErrWindowPosDoesNotMatch);
	CleanupStack::PopAndDestroy(&windowPos);
	CleanupStack::PopAndDestroy(cmdLine);
	return ETrue;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:46,代码来源:TCONE7STEP.CPP

示例14: INFO_PRINTF1

/**
   @SYMTestCaseID APPFWK-APPARC-0060
  
   @SYMPREQ CR0885
  
   @SYMTestCaseDesc
   Test apparc's use of RProcess::CreateWithStackOverride
  
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
  
   @SYMTestActions
	1. Load an application with an overly large stack requirement via RApaLsSession::StartApp.
	2. Load the application via RApaLsSession::StartDocument
	  
   @SYMTestExpectedResults
	Application should start normally both times.
  
*/
void CT_LargeStackStep::TestLargeStackL()
	{
	TApaAppInfo info;
	INFO_PRINTF1(_L("Test that the large stack example application can be found"));
	TEST(iApaLsSession.GetAppInfo(info,KLargeStackAppUid)==KErrNone);

	INFO_PRINTF1(_L("Test that the application executes without error"));
	CApaCommandLine* commandline = CApaCommandLine::NewLC();
	commandline->SetExecutableNameL(info.iFullName);
	commandline->SetCommandL(EApaCommandRunWithoutViews);
	TEST(iApaLsSession.StartApp(*commandline)==KErrNone);
	
	INFO_PRINTF1(_L("Test running the application via the legacy recogniser code."));
	TEST(iApaLsSession.TestExeRecognizerL(*commandline)==KErrNone);

	INFO_PRINTF1(_L("Test running the application via StartDocument."));
	TThreadId threadId;
	TEST(iApaLsSession.StartDocument(_L("z:\fakename.doc"), KLargeStackAppUid, threadId, RApaLsSession::ELaunchNewApp)==KErrNone);

	// Cleanup
	CleanupStack::PopAndDestroy(commandline);
	}
开发者ID:fedor4ever,项目名称:default,代码行数:42,代码来源:t_largestackstep.cpp

示例15: if

void NotifyProvider::openViewer(int index)
{
    TNotifType type;
    if (index==-1) type=EMissedCall;
    else if (index==-2) type=ESMS;
    else if (index>=0) type=iNotifiers[index].type;
    qDebug()<<"openViewer, thread"<<RThread().Id().Id();
    emit Unlock();
    CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
    if (type==ESMS)
    {//open sms
        TInt conversationview = 0;
        CRepository* cr=CRepository::NewL(KCRUidMuiuSettings);
        cr->Get(KMuiuMceDefaultView,conversationview);
        delete cr;
        CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(KMessagingCentreView, TUid::Uid( KMsvGlobalInBoxIndexEntryIdValue),KNullDesC8 );

        //iSMS->openSMS(iNotifiers[index].id);
        //if (conversationview == 1 )
        //   {CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(KConversationView, TUid::Uid( KConversationListViewid ),KNullDesC8 );}
        //else
        //   {CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(KMessagingCentreView, TUid::Uid( KMsvGlobalInBoxIndexEntryIdValue ),KNullDesC8 );}
    }
    else if (type==EEmail)
    {
    RApaLsSession session;
    session.Connect();
    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetExecutableNameL(_L("FreestyleEmailUi.exe"));
    cmdLine->SetCommandL(EApaCommandRun);
    User::LeaveIfError( session.StartApp(*cmdLine) );
    CleanupStack::PopAndDestroy(cmdLine);
    session.Close();
    }
    else if (type==EMissedCall)
    {//open calls
        LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KMissedView() );
    }
}
开发者ID:KingSD502,项目名称:dUnlock,代码行数:39,代码来源:notifyprovider.cpp


注:本文中的CApaCommandLine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。