Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Task Scheduler
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Task Scheduler
Miscellaneous
Thread ID:
00700594
Message ID:
00700594
Views:
51
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
Serge Matsevilo, Seattle, WA, USA
Senior Programmer/Analyst,
iServ Systems, Inc.
e-mail: smatsevilo@iservsystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform