×
Namespaces

Variants
Actions

Archived:Loading app image files under the \private folder may fail (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

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
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 1 (16 Aug 2007)
Last edited: hamishwillee (21 Jun 2012)

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/.

Note.pngNote: An .mbm or .mif file that contains application icons (and is referred to in the LOCALISABLE_APP_INFO resource definition) should always be installed under \resource\apps\.

This page was last modified on 21 June 2012, at 06:39.
42 page views in the last 30 days.
×