This example application demonstrates the usage of the Task Scheduler API.
Click on the following link to download the examples:
Click the following links to view the example code.
RScheduler::Connect()
and RScheduler::Register()
methods, respectively.
While registering itself with the scheduler server, the scheduler
application provides the name of the application that runs the scheduled
tasks, along with its complete path and its priority relative to other
clients. RScheduler::CreatePersistentSchedule()
method. Then, it adds a task to the persistent schedule using the RScheduler::ScheduleTask()
method. RScheduler::ScheduleTask()
method. The application passes
the schedule information to the method using the TScheduleEntryInfo2
andTTaskInfo
objects. It also edits the transient
schedule entry to change its validity using RScheduler::EditSchedule()
CScheduledTask::SecurityInfo()
method. The executor application
also checks whether the Secure ID (SID) is the same as that of the
task requester, to be able to run the tasks. If these security checks
pass, the executor prints the details of the scheduled task to the
console. RScheduler::DeleteSchedule()
and RScheduler::DeleteTask()
methods, respectively. The example shows the following APIs:
RScheduler
CScheduledTask
TScheduleEntryInfo2
TTaskInfo
TSchedulerItemRef
TSecurityInfo
To build the example:
You can build the example from the Carbide.c++ IDE or the command line.
If you use an IDE, import the bld.inf file of the example into your IDE, and use the build command of the IDE. If you use the command line, open a command prompt, and set the current directory to examples\SysLibs\TaskSchedulerExample folder which contains the bld.inf file. You can then build the example with the following build commands:
bldmake bldfiles abld build winsw (For WINSCW platforms) abld build ARMV5 (For hardware)
for running the obtained .exe, go to epoc32\release\winscw\udeb\ (or urel\), launch taskexecutor.exe :
taskexecutor.exe