Hello
Has anyone had any experience with class RScheduler, which is the API for task scheduling?
Specifically:
I have created my Rscheduler class , connected to the server (Connect() ), ,registered (Register()), created a persistent schedule, added a task and enabled it succesfully (errcode = 0).
However I don't know what kind of Dll i need to pass in Register().
I thought it's a special "epocexe" type but it doesn't get loaded by the scheduling server.
SO far I've been trying to do this:
Register ("c:\\Nokia\\task.dll",1); where task.dll is my own creation and is a dll which exports a function at ordinal 1 called WinsMain and that does this:
EXPORT_C TInt WinsMain()
{
tr("ENTER THE WINSMAIN!"😉;
#if defined(__WINS__)
E32Main();
#endif
return 0;
}
basically it should just print a message so I know it was called
------------
class CScheduledTask says this:
"Instances of this class are not accessible to clients, but are passed to the registered program through the program's TFileName parameter."
Whos TFilename parameter?? The "registered program" is a dll on the emu and right now I'm trying to make it work on the emu
RSCheduler::Register takes these 2 params:
const TFileName& aFileName - The name and full path of a program that encapsulates the client-specific knowledge for implementing tasks. On the emulator, the program should be a DLL; on an ARM processor, it should be an executable.
const TInt aPriority - A priority value.
In my case aFilename is "c:\\nokia\\task.dll", should it be this or not???
My problem is really that I don't know what that dll must look like so that it gets called by the scheduling server
----------------------------
here is a fragment of my code in the main app: (taskGUI.app)
RScheduler TheClient;
TInt err = TheClient.Connect();
TFileName aFileName = _L("c:\\Nokia\\task.dll"😉;
err = TheClient.Register(aFileName,aPriority);
err = TheClient.CreatePersistentSchedule(TSRef,
*paEntryList);
err = TheClient.ScheduleTask(aTaskInfo,
*params,
TSRef.iHandle);
err = TheClient.EnableSchedule(TSRef.iHandle);
----------------------
Thanks for your patience in reading this post 😊