For requirement 1, we have to do this
For requirement 2,we have to create a console exe program. The usefulness of such programs is that it works in background. So, one cannot view the program as a task in running application viewer.
For requirement 3, we have to install an active scheduler in the ConsoleApp.cpp file (where the function E32Main() resides). We can put the following 3 lines of code in the E32Main() function :
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
CleanupStack::PushL(scheduler);
CActiveScheduler::Install(scheduler);
This active scheduler is what the program will work taking the help of.Then after initializing the appropriate classes, we have to start the active scheduler. Let me give a specific example:

And then in the DoStartL() function -

Now, if any class (i.e CCallStatusNotifier or CImageDownloader in my example) is an active object type class then we can add the active object to active scheduler like this:
void CCallStatusNotifier::ConstructL()
{
CActiveScheduler::Add(this);
}
And then you will be able to use that active scheduler like normal active scheduler

0 comments:
Post a Comment