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


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

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


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

示例1: GetTaskInfo

//---------------------------------------------------------------------------
int TTaskScheduler::GetTaskInfo(wstring taskName, TTaskParams& taskParams){
    ITask *pITask = Activate(taskName);

    if(pITask == NULL){
        return 0;
    }

    LPWSTR ppwszAccountName;
    LPWSTR ppwszComment;
    LPWSTR ppwszCreator;
    LPWSTR lpwszApplicationName;
    LPWSTR lpwszParameters;
    LPWSTR lpwszWorkDir;

    DWORD pdwExitCode;
    DWORD pdwRunTime;
    DWORD pdwPriority;

    WORD pwIdleMinutes;
    WORD pwDeadlineMinutes;
    SYSTEMTIME pstLastRun;
    SYSTEMTIME pstNextRun;
    HRESULT phrStatus;


  
    HRESULT hr = pITask->GetAccountInformation(&ppwszAccountName);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
        taskParams.accountName = L"";
    }else{
        taskParams.accountName = ppwszAccountName;
        CoTaskMemFree(ppwszAccountName);
    }

    hr = pITask->GetApplicationName(&lpwszApplicationName);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.appName = lpwszApplicationName;
        CoTaskMemFree(lpwszApplicationName);
    }

    hr = pITask->GetComment(&ppwszComment);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.comments = ppwszComment;
        CoTaskMemFree(ppwszComment);
    }

    hr = pITask->GetCreator(&ppwszCreator);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.creator = ppwszCreator;
        CoTaskMemFree(ppwszCreator);
    }

    hr = pITask->GetExitCode(&pdwExitCode);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.exitCode = pdwExitCode;
    }

    hr = pITask->GetIdleWait(&pwIdleMinutes, &pwDeadlineMinutes);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.deadlineMinutes = pwDeadlineMinutes;
        taskParams.idleMinutes = pwIdleMinutes;
    }

    hr = pITask->GetMaxRunTime(&pdwRunTime);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.maxRuntime = pdwRunTime;
    }

    hr = pITask->GetMostRecentRunTime(&pstLastRun);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.lastRun = pstLastRun;
    }

    hr = pITask->GetNextRunTime(&pstNextRun);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
        taskParams.nextRun = pstNextRun;
    }

    hr = pITask->GetParameters(&lpwszParameters);
    if (FAILED(hr)){
        sprintf(lastError, "Failed to retreive task info, error = 0x%x\n",hr);
    }else{
//.........这里部分代码省略.........
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:101,代码来源:TTaskScheduler.cpp


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