Hi friends,
For timer,i have used callback method.That method calls one of static method where
there is some requirement of nonstatic member.so that can i use non static member in
static method.AFAIK in c++, we can't use nonstatic members in static method.In symbian i
don't know whether any api supports or not.
Anybody's help would be appreciate.
Regards
mitu
TInt CAirChordRadioAppUi::TimerExpired(TAny* aPtr)
{
return ((CAirChordRadioAppUi*)aPtr)->DeleteIndicator();///i have updated it after saw ur given code
//here i want to call given deleteindicator method.it contents
non static members.so that creates problem.bcz here TimerExpired method is static.
}
void CAirChordRadioAppUi::DeleteIndicator()
{
if(iIndicatorIcon1)
{
delete iIndicatorIcon1;
iIndicatorIcon1=NULL;
}
}
please tell me where i m wrong?
Regards
mitu
Sorry, I am really confused.
Because I think your code is correct.
Maybe you declare DeleteIndicator as static method, and iIndicatorIcon1 is a non static member...I guess.
If it's true, you have to declare DeleteIndicator as non static member method.
hi yangy,
Here TimerExpired(TAny* aPtr) is static method.
DeleteIndicator is a non-static method.Giving error when i am calling deleteIndicator method inside
TimerExpired(that nonstatic member in static method).so that what should i do.please give me some concern this issue.
Regards
mitu
Forum posts: 8
Pass the pointer of the object as parameter to your static method.
Forum posts: 55
Hi yangy,
Thanks for ur instant reply.Here i m using CTimer class.
i have written following codes.
all are in AppUi class
void CAirChordRadioAppUi::Timer()
{
iDisplayTimer = new (ELeave) CCallTimer(
TCallBack( TimerExpired ,this ) );
iDisplayTimer->Wait(TInt(3E6));
}
TInt CAirChordRadioAppUi::TimerExpired(TAny* aPtr)
{
return ((CAirChordRadioAppUi*)aPtr)->DeleteIndicator();///i have updated it after saw ur given code
//here i want to call given deleteindicator method.it contents
non static members.so that creates problem.bcz here TimerExpired method is static.
}
void CAirChordRadioAppUi::DeleteIndicator()
{
if(iIndicatorIcon1)
{
delete iIndicatorIcon1;
iIndicatorIcon1=NULL;
}
}
please tell me where i m wrong?
Regards
mitu
Forum posts: 8
Sorry, I am really confused.
Because I think your code is correct.
Maybe you declare DeleteIndicator as static method, and iIndicatorIcon1 is a non static member...I guess.
If it's true, you have to declare DeleteIndicator as non static member method.
http://developer.uiq.com/devlib/uiq_31/SDKDocumentation/doc_source/doc_source/examples/e32Ex/TimersAndTimingServicesExampleCode.guide.html
Forum posts: 55
hi yangy,
Here TimerExpired(TAny* aPtr) is static method.
DeleteIndicator is a non-static method.Giving error when i am calling deleteIndicator method inside
TimerExpired(that nonstatic member in static method).so that what should i do.please give me some concern this issue.
Regards
mitu
Forum posts: 8
DeleteIndicator return void, TimerExpired return int,
So "return ((CAirChordRadioAppUi*)aPtr)->DeleteIndicator();" is incorrect.
Is it the error?
Forum posts: 55
Hi yangy,
yes,exactly in this line getting error.so what i should change in this line.
Regards
mitu
Forum posts: 8
Forum posts: 55
HI yangy,
Thanks for ur response.i have returned the 0 value in my deleteindicator method. now it running without any error.
Thanks
mitu