Hi everybody,
I'm trying to call AknIconUtils::CreateIconL from different thread and from a standalone class (which does not extend anything). Unfortunately the CreateIconL method throws KERN-EXEC 3.
Anyone who can help me here ?
Thanks
Hi everybody,
I'm trying to call AknIconUtils::CreateIconL from different thread and from a standalone class (which does not extend anything). Unfortunately the CreateIconL method throws KERN-EXEC 3.
Anyone who can help me here ?
Thanks
Because of the separate thread it probably requires you to have your own RFbsSession Connect-ed. Perhaps some other things too, you will see if it helps.
Thanks for the answer.
here is my initialization :
Code:User::LeaveIfError(iFbsSession.Connect()); User::LeaveIfError(iWs.Connect()); iScreenDevice = new(ELeave) CWsScreenDevice(iWs); iScreenDevice->Construct(); TPixelsTwipsAndRotation curPixTwipsRot; iScreenDevice->GetDefaultScreenSizeAndRotation(curPixTwipsRot); TRect screenRect = curPixTwipsRot.iPixelSize; iWg = iWs; User::LeaveIfError(iWg.Construct(reinterpret_cast<TUint32>(&iWg), EFalse)); iWg.SetOrdinalPosition(10, ECoeWinPriorityAlwaysAtFront); User::LeaveIfError(iScreenDevice->CreateContext(iGc)); iWindow = iWs; User::LeaveIfError(iWindow.Construct(iWg, reinterpret_cast<TUint32>(&iWg) + 1)); iWindow.SetBackgroundColor(TRgb(0xff, 0xfa, 0xfa)); iWindow.Activate(); iWindow.SetExtent(TPoint(0, 0), TSize(screenRect.Width(), screenRect.Height())); iWindow.SetVisible(ETrue); iGc->Activate(iWindow);I tried to add RFbsSession but it still throws KERN-EXEC 3.Code:RWsSession iWs; RWindowGroup iWg; CWindowGc* iGc; RWindow iWindow; CWsScreenDevice* iScreenDevice; RFbsSession iFbsSession;
The RFbsSession thing was the only one I am aware of, but you can check if AknIconUtils is present in the open source Symbian code.
I did it, now I use the following code
Thanks for the advice.Code:CEikonEnv* env = new CEikonEnv(); TRAPD(err, env->ConstructL()); User::LeaveIfError(iFbsSession.Connect(env->FsSession()));
Best Regards
And another question, is it possible to access the resources from a different thread ? I need to access few localizable strings. I guess I'll need to pass them beforehand.
Although it is a bit redundant (since the resources are loaded in your main thread already), as a quick workaround, you could try using CCoeEnv::AddResrourceFileL on your newly created CEikonEnv. BaflUtils::NearestLanguageFile can help in picking the right file (if you are supporting multiple languages).