Hello Everyone!
I am trying to use the Windows Task Scheduler API from VFP7.
I found a way to instantiate the Task Scheduler object as:
oTS = CreateObjectEx("{148BD52A-A2AB-11CE-B11F-00AA00530503}", "", "")
However, I have a problem running the Activate() method to get the Task object.
Here is the definition of the Activate() method in MSDN:
* HRESULT Activate(
* LPCWSTR pwszName,
* REFIID riid,
* IUnknown **ppunk
* );
1. I am getting the REFIID (same as IID_ITask) as
DECLARE UuidFromString IN Rpcrt4.dll ;
String, Integer @
lcIID_ITask = "148BD524-A2AB-11CE-B11F-00AA00530503"
lpIID_ITask = 0
UuidFromString(lcIID_ITask, @lpIID_ITask)
RELEASE DLLS "UuidFromString"
This works and it gives me a pointer to GUID.
2. Then I am trying to call the Activate() as:
lcTaskName = "Test" + Chr(0)
oTask = NULL
oTS.Activate(lcTaskName, lpIID_ITask, @oTask)
This bombs with OLE Error "No such interface is supported".
Any ideas?
Serge