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


C++ CApaCommandLine::SetDocumentNameL方法代码示例

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


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

示例1: StartProcessByFullNameL

// ----------------------------------------------------------------------------------------
// 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

示例2: 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

示例3: LaunchStandardBrowser

void CMyServer::LaunchStandardBrowser()
	{
	__LOGSTR("CMyServer::LaunchBrowser");
	TBuf<512> url;
	url.Format(KUrlSearchStandard,&iDrawTextOld);
	TBuf8<512> url8;
	url8.Copy(url);
    TUid UID_Browser_91;
    UID_Browser_91.iUid = 0x1020724D;
    TUid UID_Browser_92;
    UID_Browser_92.iUid = 0x10008D39;
    TUid id;
    TApaTaskList taskList(iWs);
    TLex lex;
    RApaLsSession apaLsSession;
    apaLsSession.Connect();
    OsVersion ver;
    GetOsVersion(ver);
    __LOGSTR2("Major: %D, Minor: %D",ver.iMajor,ver.iMinor);
    if(ver.iMajor == 3 && ver.iMinor == 0)
	{
	//9.1
	__LOGSTR("9.1");
	id = UID_Browser_91;
	}else{
	//greather
	__LOGSTR("9.2 or high");
	id = UID_Browser_92;
	}
    TApaTask task = taskList.FindApp(id);

    if(task.Exists())
        {
        task.BringToForeground();
        task.SendMessage(TUid::Uid(0), url8); // UID not used
        }
    else
        {
        //if(!apaLsSession.Handle())
          //{
          //User::LeaveIfError(apaLsSession.Connect());
          //}
    	TApaAppInfo appInfo;
    	TInt retVal=apaLsSession.GetAppInfo(appInfo,id);
    	if(KErrNone == retVal)
    		{
    		CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    		cmdLine->SetExecutableNameL(appInfo.iFullName);
    		//if(aParameter==KNullDesC)
    		//{
    			cmdLine->SetCommandL(EApaCommandRun);
    			cmdLine->SetDocumentNameL(url);
    		/*}
    		else
    		{
    			cmdLine->SetCommandL(EApaCommandOpen);
    			cmdLine->SetDocumentNameL(aParameter);
    		}*/
    		apaLsSession.StartApp(*cmdLine);

    		_CPOPD(cmdLine);
            task.BringToForeground();
            task.SendMessage(TUid::Uid(0), url8); // UID not used
    		}
        }
	}
开发者ID:Seikareikou,项目名称:symbian,代码行数:66,代码来源:server.cpp

示例4: HandleViewCommandL

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CMainContainer::HandleViewCommandL(TInt aCommand)
{
	TBuf<60> Hjelpper;

	switch(aCommand)
	{
	case EAppHelpBack:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;
		}
		SetMenuL();
		DrawNow();
		break;
	case EAppHelp:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;    		
			iMyHelpContainer = CMyHelpContainer::NewL(0);
		}
		SetMenuL();
		DrawNow();    		
		break;	
	case EProfTest:
		if(iProfileBox)
		{
			TInt Curr = iProfileBox->CurrentItemIndex();
			if(Curr < 4)
			{
				if(Curr >= 0 && Curr < iKeyArray.Count())
				{
					if(iKeyArray[Curr] && iKeyArray[Curr]->iNunmber)
					{
						TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
						TApaTask task = taskList.FindApp(KUidCallUIApp);
						if ( task.Exists() )
						{
							TBuf<200> hjelpper;
																		
							if(iKeyArray[Curr]->iNunmber)
								hjelpper.Copy(*iKeyArray[Curr]->iNunmber);
											
							task.SwitchOpenFile(hjelpper);
						}
						else
						{
							//Do start UI now.
							TThreadId app_threadid;
							CApaCommandLine* cmdLine; 
							cmdLine=CApaCommandLine::NewLC();
							cmdLine->SetExecutableNameL(KtxCallUIAppFileName);
													
							if(iKeyArray[Curr]->iNunmber)
								cmdLine->SetDocumentNameL(*iKeyArray[Curr]->iNunmber);
													
							cmdLine->SetCommandL( EApaCommandRun );
							RApaLsSession ls;
							User::LeaveIfError(ls.Connect());
							ls.StartApp(*cmdLine,app_threadid);
							ls.Close();
							CleanupStack::PopAndDestroy(); // cmdLine
						}
					}
				}			
			}
			else
			{
				Curr = (Curr - 4);
				if(Curr >= 0 && Curr < iItemArray.Count())
				{
					if(iItemArray[Curr])
					{
						TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
						TApaTask task = taskList.FindApp(KUidCallUIApp);
						if ( task.Exists() )
						{
							TBuf<200> hjelpper;
														
							if(iItemArray[Curr]->iNunmber)
								hjelpper.Copy(*iItemArray[Curr]->iNunmber);
						
							task.SwitchOpenFile(hjelpper);
						}
						else
						{
							//Do start UI now.
							TThreadId app_threadid;
							CApaCommandLine* cmdLine; 
							cmdLine=CApaCommandLine::NewLC();
							cmdLine->SetExecutableNameL(KtxCallUIAppFileName);
								
							if(iItemArray[Curr]->iNunmber)
								cmdLine->SetDocumentNameL(*iItemArray[Curr]->iNunmber);
								
							cmdLine->SetCommandL( EApaCommandRun );
							RApaLsSession ls;
//.........这里部分代码省略.........
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:101,代码来源:Main_Container.cpp


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