Problem with active object - CTimer - SetActive()
| Thu, 2007-09-20 13:45 | |
|
Hi all, I want to make this timer work but it crashes on SetActive() command. Class symbian_timer_helper is derived from : public CTimer. It crashes but does not even run RunL() command of CTimer! It does not even start the timer if I remove SetActive(). Here is the code: void symbian_timer_helper::base_constructL() symbian_timer_helper * symbian_timer_helper::constructL() After this start is called: void symbian_timer_helper::start(int timeout_value, SetActive() ; // mega-crash but why??? Where ussualy problems are with SetActive() command? Thanx very much in advance !! |
|






Forum posts: 732
I think you should understand the basics of the Active Shecduler (AS) first. Hope there are plenty of articles available from NewLC tutorials and Forum Nokia Wiki, just do a search. Before calling SetActve you should call an asynchronous function where in which you should pass the iStatus (which is an object of CActive a TRequestStust type).
The next thing is you've some misconception on CounstructL(). A part of code in ConstructL() should be moved to the NewL()/NewLC() function. AFAIK your ConstructL() can't return any value, you can call any of the leaving functions inside it. Search for Two-Phase construction and CleanupStack. Another observation is that you've not followed the Symbian naming conventions properly.
I would recommend you to check any of the implementation of CTimer with SDK Help to get know more about it.
Forum posts: 78
Read the documentation for CTimer, it says you have to provide an implementation of RunL(), where is it?
Forum posts: 131
I bet it is a E32USER-CBase 42 panic. SetActive() was already called in CTimer::After(...).
Forum posts: 4
Thanx sysctl-forum
i have removed SetActive() and now everything works fine!
bye