Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Invoking Task Scheduler Wizard through API

Invoking Task Scheduler Wizard through API

Scheduled Pinned Locked Moved C / C++ / MFC
databasecomjsonhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    insanely420
    wrote on last edited by
    #1

    Greetings I have a command line tool and I want to provide a GUI interface to schedule the tool to perform its job. Now the problem is how do you I invoke the Query Interface wizard thru API? I can create a test sample job using the following code but I am unable to start the wizard so that the user can set it times directly thru my app. Thanks in advance. ITaskScheduler * sITS; HRESULT InitTSAPI() { HRESULT hr = S_OK; _ASSERTE ( SUCCEEDED(CoInitialize(NULL)) ); // init COM if (SUCCEEDED(hr)) { hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, IID_ITaskScheduler, (void **) &sITS); if (FAILED(hr)) { return hr; CoUninitialize(); } } return hr; } HRESULT CreateTask ( WCHAR * pTaskName ) { HRESULT hr = S_OK; ITask * task = 0; IPersistFile * pFile = 0; hr = sITS->NewWorkItem( pTaskName, CLSID_CTask, IID_ITask, (IUnknown**)&task ); if ( FAILED ( hr )) return hr; hr = task->QueryInterface(IID_IPersistFile, (void **)&pFile); task->Release(); hr = pFile->Save ( NULL, TRUE); _ASSERTE ( SUCCEEDED ( hr )); pFile->Release(); return S_OK; } void main() { InitTSAPI(); CreateTask(L"Test Task"); sITS->Release(); }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups