How can I schedule tasks based on DLL or EXE using Symbian C++?
How can I schedule tasks based on DLL or EXE?
Scheduling DLL or EXE-based tasks using the RScheduler class requires a certain technique to implement the EXE and DLL.
To schedule a DLL-based task in the emulator, implement the DLL as follows:
LOCAL_D TInt StartDLL(TAny* aParam)
CMyDll* self = new(ELeave) CMyDll;
EXPORT_C TThreadFunction ThreadFunction()
// Ordinal one export that returns the function
// which extracts the pseudo-command line
// under WINS, this is passed as thread data).
GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
Further information: The aParam passed in StartDLL can be used as follows to create CScheduledTask objects:
TFileName* fileName = reinterpret_cast<TFileName*>(aParam);
CcFileStore* store = CDirectFileStore::OpenLC(iFsSession, fileName, EFileRead);
// Get task count
TInt count = instream.ReadInt32L();
__ASSERT_ALWAYS(count > 0, Panic(ETaskExePanicNoScheduledTasks));
for (TInt i=0;i<count;i++)
CScheduledTask* task =
To schedule an EXE-based task in the device, implement the EXE as follows:
GLDEF_C TInt E32Main()
LOCAL_C TInt Test(TDesC& aTaskDataFile)
// Extract scheduled tasks as shown above.