本文整理汇总了C++中CApaCommandLine::SetServerRequiredL方法的典型用法代码示例。如果您正苦于以下问题:C++ CApaCommandLine::SetServerRequiredL方法的具体用法?C++ CApaCommandLine::SetServerRequiredL怎么用?C++ CApaCommandLine::SetServerRequiredL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApaCommandLine
的用法示例。
在下文中一共展示了CApaCommandLine::SetServerRequiredL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LaunchAppL
// ---------------------------------------------------------------------------
// 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 );
}
示例2: StartAsyncL
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;
}