Hello Everyone!
I am trying to use the Windows Task Scheduler in VFP7.
I 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()
* 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"
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". I understand that it wants a pointer to a an Interface pointer. But how do I get that in VFP7?
Any ideas would be greatly appreciated!
Serge