Archived:Loading app image files under the \private folder may fail (Known Issue)
Using AknIconUtils to load icons or graphics may fail on S60 3rd Edition if the image file is located under a protected folder.
Article Metadata
Compatibility
Article
Description
Trying to use the following method from AknIconUtils (akniconutils.h) will fail on S60 3rd Edition if the image file aFileName is in a protected folder, for example, under \private\appUID\:
void CreateIconL( CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFileName,
TInt aBitmapId,
TInt aMaskId )
This happens because the Avkon icon server cannot access files located under protected folders.
How to reproduce
The AknIconUtils::CreateIconL() method does not leave in this situation; however, aBitmap and aMask parameters are not pointing to valid bitmaps. Any attempt to use the returned bitmaps will fail or cause a panic.
For example, trying to set the size of the bitmap with AknIconUtils::SetSize() will return error -46 (KErrPermissionDenied).
Solution
Instead of passing a filename to CAknIconUtils, applications should implement the mix-in class MAknIconFileProvider to provide an opened file handle that can be used by the Avkon icon server.
CAknIconUtils has overloaded variants of the CreateIconL() method that will accept a reference to the MAknIconFileProvider instance. For an example implementation of MAknIconFileProvider class, see S60 Platform: Scalable Screen-Drawing Example, available for download at http://www.developer.nokia.com/.

