本文整理汇总了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();
}
示例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] = "";
示例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) )
{