Hi
I want to start another thread from within a CActive class.
I understand that a good way is to create another CActive derived class and start it.
I added the relevant init code of my main CActive derived class.
also there is non working code I tried in the RunL method ...
What is the way to start a new thread from the main CActive class ?
does the second CActive class have the same init methods ?
Do I have to create a new scheduler ?
Do I use SetActive() in the second thread ?
Please advise about this issue
Thanks in advance
Code:void CMyAppUi::ConstructL() { iActiveClass=CActiveClass::NewL(this); } CActiveClass* CActiveClass::NewL(CMyAppUi * aAppUi) { CActiveClass* self = new (ELeave) CActiveClass(); self->iAppUi = aAppUi; CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); return self; } CActiveClass::CActiveClass() : CActive(CActive::EPriorityStandard) { CActiveScheduler::Add(this); } void CActiveClass::ConstructL() { SetActive(); } void CActiveClass::RunL() { //*** here I want to start another Active Class *** /* I tried this code but it didnt work : iSecondActiveClass=CSecondActiveClass::NewL(iAppUi); CActiveScheduler* current = CActiveScheduler::Current(); CActiveScheduler* scheduler = new (ELeave) CActiveScheduler; CActiveScheduler::Install(NULL); CActiveScheduler::Install(scheduler); CActiveScheduler::Add(iSecondActiveClass); CActiveScheduler::Start(); CActiveScheduler::Replace(current);*/ }

Reply With Quote

