Hi All,
i am working on a project. my requirement , i have to send the messages after one hours or 2 or 3 or 4 hours . my application is running in the background . i have used the After() function but it takes maximum
value 35min . how i can do this . please reply me if anybody knows
Re: Activate the request after hours using Acive abjects
Why not simply implement a counter for half-hours? If you have to wait e.g. for 3 hours, set the counter to 6, set the wait period for After() to half an hour, decrement the counter whenever After() returns, and if the counter is not yet zero, wait another half hour with After().
Re: Activate the request after hours using Acive abjects
Create your own timer class which encapsulate the call to RTimer and do as RBrunner wrote (i.e. split the time to wait in 35minutes chunk and add a counter). I have done this for one project and it works very well.
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Re: Activate the request after hours using Acive abjects
RTimer::At() is really useful. I used it to launch a request at a particular time,and also my application ran in background.My CMyTimer::Start(TTime& aTime) function ws like this:
{
......
At(aTime);
......
}
And at the right time to user iMyTimer->Start(time); then it will go into the RunL() function to do the required job.
Forum posts: 1144
Why not simply implement a counter for half-hours? If you have to wait e.g. for 3 hours, set the counter to 6, set the wait period for After() to half an hour, decrement the counter whenever After() returns, and if the counter is not yet zero, wait another half hour with After().
René Brunner
Forum posts: 79
Thanks for reply..
please tell me in detail. i am Waiting for you reply..
void CScheduleTimer::RunL()
{
if (iStatus == KErrNone )
{
if(CheckScheduleL())
{
iXMLEngine = CXmlController::NewL(this);
iXMLEngine->iLocation = iSmsHandler->iDatabase->GetLocation();
iXMLEngine->GenerateXML(ELocationMessage);
}
After(iInterval);
}
else
CActiveScheduler::Stop();
}
void CScheduleTimer::ConstructL(CSmsHandler *iSmsHandler, TTimeIntervalMicroSeconds32 aInterval)
{
CActiveScheduler::Add(this);
iTimer.CreateLocal();
this->iInterval = aInterval;
iXMLEngine = NULL;
this->iSmsHandler = iSmsHandler;
After(iInterval);
}
void CScheduleTimer::After(TTimeIntervalMicroSeconds32 aInterval)
{
Cancel();
iTimer.After(iStatus,aInterval);
SetActive();
}
i am getting iInterval from database...
please tell me what i can do ..value may be 45min 2 hous ,30 min 5 min,,,
Forum posts: 1913
Create your own timer class which encapsulate the call to RTimer and do as RBrunner wrote (i.e. split the time to wait in 35minutes chunk and add a counter). I have done this for one project and it works very well.
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 110
Alternatively your can use RTimer::At() for long delays (e.g. Alarms).
Forum posts: 151
Why have a timer that goes off every 1/2 hour and then do some calculation when as fig7 says you can use At()?
Forum posts: 2
RTimer::At() is really useful. I used it to launch a request at a particular time,and also my application ran in background.My CMyTimer::Start(TTime& aTime) function ws like this:
{
......
At(aTime);
......
}
And at the right time to user iMyTimer->Start(time); then it will go into the RunL() function to do the required job.