Location
на уникальный URL для удаления именно этого списка идентификаторов и сделать на него delete-запрос. Это RESTful способ, не нарушающий стандартов. #include <windows.h>
#include <initguid.h>
#include <ole2.h>
#include <mstask.h>
#include <msterr.h>
#include <objidl.h>
#include <wchar.h>
#include <stdio.h>
int main(int argc, char **argv) {
HRESULT hr = S_OK;
ITaskScheduler *pITS;
hr = CoInitialize(NULL);
if (SUCCEEDED(hr)) {
hr = CoCreateInstance(&CLSID_CTaskScheduler,
NULL,
CLSCTX_INPROC_SERVER,
&IID_ITaskScheduler,
(void **) &pITS);
if (FAILED(hr)) {
CoUninitialize();
return 1;
}
}
else {
return 1;
}
LPCWSTR pwszTaskName;
ITask *pITask;
IPersistFile *pIPersistFile;
pwszTaskName = L"Test Task";
hr = pITS->lpVtbl->NewWorkItem(pITS,
pwszTaskName, // Name of task
&CLSID_CTask, // Class identifier
&IID_ITask, // Interface identifier
(IUnknown**) &pITask); // Address of task
// interface
pITS->lpVtbl->Release(pITS); // Release object
if (FAILED(hr)) {
CoUninitialize();
fprintf(stderr, "Failed calling NewWorkItem, error = 0x%x\n", hr);
return 1;
}
hr = pITask->lpVtbl->QueryInterface(pITask, &IID_IPersistFile, (void **) &pIPersistFile);
pITask->lpVtbl->Release(pITask);
if (FAILED(hr)) {
CoUninitialize();
fprintf(stderr, "Failed calling QueryInterface, error = 0x%x\n", hr);
return 1;
}
hr = pIPersistFile->lpVtbl->Save(pIPersistFile, NULL, TRUE);
pIPersistFile->lpVtbl->Release(pIPersistFile);
if (FAILED(hr)) {
CoUninitialize();
fprintf(stderr, "Failed calling Save, error = 0x%x\n", hr);
return 1;
}
CoUninitialize();
printf("Created task.\n");
return 0;
}