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


C++ ITask::SetWorkingDirectory方法代码示例

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


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

示例1: SetTaskProperties

//---------------------------------------------------------------------------
void TTaskScheduler::SetTaskProperties(wstring taskName, TTaskParams taskParams){
    ITask *pITask = Activate(taskName);

    if(pITask == NULL){
        return;
    }


    if(taskParams.accountName.length() > 0 && taskParams.accountPwd.length() > 0){
        pITask->SetAccountInformation(taskParams.accountName.data(),
                                      taskParams.accountPwd.data());
    }

    if(taskParams.appName.length() > 0){
        pITask->SetApplicationName(taskParams.appName.data());
    }

    if(taskParams.appParameters.length() > 0){
        pITask->SetParameters(taskParams.accountName.data());
    }

    if(taskParams.comments.length() > 0){
        pITask->SetComment(taskParams.comments.data());
    }

    if(taskParams.workingDirectory.length() > 0){
        pITask->SetWorkingDirectory(taskParams.workingDirectory.data());
    }

    Save(pITask);
    pITask->Release();

}
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:34,代码来源:TTaskScheduler.cpp

示例2: SaveTask


//.........这里部分代码省略.........


    // Set the program name.

    hr = pITask->SetApplicationName ( T2COLE( (LPCTSTR) m_sProgramPath ));

    if ( FAILED(hr) )
        {
        TRACE1("CScheduledTask::SaveTask() - failed to set application. Return = 0x%08X\n",
               (DWORD) hr );
        return hr;
        }


    // Set the app's parameters.

    if ( m_sParameters.GetLength() > 0 )
        {
        hr = pITask->SetParameters ( T2COLE( (LPCTSTR) m_sParameters ));

        if ( FAILED(hr) )
            {
            TRACE1("CScheduledTask::SaveTask() - failed to set parameters. Return = 0x%08X\n",
                   (DWORD) hr );
            return hr;
            }
        }        


    // Set the starting directory.

    if ( m_sStartingDir.GetLength() > 0 )
        {
        hr = pITask->SetWorkingDirectory ( T2COLE( (LPCTSTR) m_sStartingDir ));

        if ( FAILED(hr) )
            {
            TRACE1("CScheduledTask::SaveTask() - failed to set starting directory. Return = 0x%08X\n",
                   (DWORD) hr );
            return hr;
            }
        }


	TCHAR infoBuf[32767];
	DWORD bufCharCount = 32767;

	GetUserNameEx(NameSamCompatible, infoBuf, &bufCharCount);
	hr = pITask->SetAccountInformation((LPCWSTR)infoBuf, L"");

    // Set the job comment.

    if ( m_sComment.GetLength() > 0 )
        {
        hr = pITask->SetComment ( T2COLE( (LPCTSTR) m_sComment ));

        if ( FAILED (hr) )
            {
            TRACE1("CScheduledTask::SaveTask() - failed to set task comment. Return = 0x%08X\n",
                   (DWORD) hr );
            return hr;
            }
        }

    //TCHAR pszName[CREDUI_MAX_USERNAME_LENGTH] = "";
    //TCHAR pszPwd[CREDUI_MAX_PASSWORD_LENGTH] = "";
开发者ID:DjPasco,项目名称:Mag,代码行数:67,代码来源:ScheduledTask.cpp

示例3: SaveTask


//.........这里部分代码省略.........
    // wskaznika do IUnknown juz nie potrzebujemy  
    pIUnk->Release();
    pIUnk = NULL;


    // ustawiamy nazwe dla aplikacji
    hr = pITask->SetApplicationName ( T2COLE( (LPCTSTR) m_sProgramPath ));

    if ( FAILED(hr) )
        {
        TRACE1("CTask::SaveTask() - failed to set application. Return = 0x%08X\n",
               (DWORD) hr );
        return hr;
        }


    // ustawiamy parametry dla aplikacji
    if ( m_sParameters.GetLength() > 0 )
        {
        hr = pITask->SetParameters ( T2COLE( (LPCTSTR) m_sParameters ));

        if ( FAILED(hr) )
            {
            TRACE1("CTask::SaveTask() - failed to set parameters. Return = 0x%08X\n",
                   (DWORD) hr );
            return hr;
            }
        }        


    // ustawiamy folder startowy dla aplikacji
    if ( m_sStartingDir.GetLength() > 0 )
        {
        hr = pITask->SetWorkingDirectory ( T2COLE( (LPCTSTR) m_sStartingDir ));

        if ( FAILED(hr) )
            {
            TRACE1("CTask::SaveTask() - failed to set starting directory. Return = 0x%08X\n",
                   (DWORD) hr );
            return hr;
            }
        }


    // ustawiamy nazwe uzytkownika i haslo, jesli jestesmy na NT
    if ( m_bNT )
        {
        hr = pITask->SetAccountInformation ( T2COLE( (LPCTSTR) m_sAccount),
                                             T2COLE( (LPCTSTR) m_sPassword) );

        if ( FAILED(hr) )
            {
            TRACE1("CTask::SaveTask() - failed to set account info.  Return = 0x%08X\n",
                   (DWORD) hr );
            return hr;
            }
        }


    // ustawiamy komentarz do zadania
    if ( m_sComment.GetLength() > 0 )
        {
        hr = pITask->SetComment ( T2COLE( (LPCTSTR) m_sComment ));

        if ( FAILED (hr) )
            {
开发者ID:tuku1185,项目名称:taskscheduler,代码行数:67,代码来源:CTask.cpp


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