×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    18

    AknIconUtils::CreateIconL() returning KErrNotFound

    I'm using AknIconUtils::CreateIconL(CFbsBitmap*& aBitmap,CFbsBitmap*& aMask,const TDesC& aFileName, TInt aBitmapId, TInt aMaskId ) and I'm getting an error KErrNotFound(-1) I checked whether the file was correct with AknIconUtils::IsMifFile() and also checked if I was using the right bitmad ids. So I don't know what the problem is.

    Code:
    _LIT(KYourMifFile,"Test_0xE42A0B5B.mif");
    TBuf< 100 > driveAndPath;
    	TBuf< 2 > appDrive;
    	appDrive.Copy(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName().Left(2));
    	driveAndPath.Copy(appDrive);
    	driveAndPath.Append(_L("\\resource\\apps\\"));
    	driveAndPath.Append(KYourMifFile);
    if(AknIconUtils::IsMifFile(driveAndPath))
    		AknIconUtils::CreateIconL(iIcon,iIcon_M, driveAndPath,EMbmTest_0xe42a0b5bErr_icon, EMbmTest_0xe42a0b5bErr_icon_mask);
    Code:
    enum TMifTest_0xe42a0b5b
    	{
    	EMbmTest_0xe42a0b5bQgn_menu_test = 16384,
    	EMbmTest_0xe42a0b5bOk_bttn = 16386,
    	EMbmTest_0xe42a0b5bErr_icon = 16388,
    	EMbmTest_0xe42a0b5bOk_bttn2 = 16390,
    	EMbmTest_0xe42a0b5bErr_icon_mask = 16392,
    	EMbmTest_0xe42a0b5bOk_bttn_mask = 16394,
    	EMbmTest_0xe42a0b5bLastElement
    	};

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    Though this is the first time I have ever heard about this method, its documentation uses a very clear wording
    Quote Originally Posted by SDK Help
    static IMPORT_C TBool AknIconUtils::IsMifFile ( const TDesC & aFileName ) [static]

    Tells whether the given file name is recognized as a MIF file or not.

    Only the file name extension is examined, not the contents of the file.
    your file is somewhere else/something else/does not exist at all (on the device).

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    18

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    Besides using that method I also used
    Code:
    RFs fileS;
    RFile file;
    fileS.Connect();
    TInt x = file.Open(fileS, driveAndPath, EFileRead);
    and x gets set to KErrNone.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    Are we discussing about an emulator or a device?
    In case of an emulator, note that your code runs from drive z:, the "ROM". Although putting your file into epoc32\release\winscw\udeb\z\... may work, fixing the drive letter as c: for the emulator case (#ifdef __WINS__ and the like) is also a common approach - this way you should put the file into epoc32\winscw\c\...
    If we are discussing about problems on a device, show your .pkg file.

  5. #5
    Registered User
    Join Date
    Jul 2009
    Posts
    18

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    I'm installing on the device
    Code:
    ;Files to install
    ;You should change the source paths to match that of your environment
    ;<source> <destination>
    "$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\Test_0xE42A0B5B.exe"		-"!:\sys\bin\Test_0xE42A0B5B.exe"
    "$(EPOCROOT)Epoc32\data\z\resource\apps\Test_0xE42A0B5B.rsc"		-"!:\resource\apps\Test_0xE42A0B5B.rsc"
    "$(EPOCROOT)Epoc32\data\z\private\10003a3f\apps\Test_0xE42A0B5B_reg.rsc"	-"!:\private\10003a3f\import\apps\Test_0xE42A0B5B_reg.rsc"
    "$(EPOCROOT)Epoc32\data\z\resource\apps\Test_0xE42A0B5B.mif" -"!:\resource\apps\Test_0xE42A0B5B.mif"
    ;"..\help\Test_0xE42A0B5B.hlp"							 -"!:\resource\help\Test_0xE42A0B5B.hlp"
    
    ; Add any installation notes if applicable
    ;"Test.txt"		-"!:\private\E42A0B5B\Test.txt"
    
    ;required for application to be covered by backup/restore facility 
    "..\sis\backup_registration.xml"		-"!:\private\E42A0B5B\backup_registration.xml"

  6. #6
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    In the driveAndPath buffer, append only the following:

    \\resource\\apps\\YourMifame.mif


    & for emulator: z:\\resource\\apps\\YourMifame.mif

  7. #7
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    260

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    Quote Originally Posted by washellington View Post
    I'm installing on the device
    Hi,

    Are you using SVG or bitmap icons? If bitmaps, you'll need to install Test_0xE42A0B5B.mbm also.

    -TongMuan

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    TongMuan is probably right. The presence of _mask identifiers with even numeric value suggest that you have .bmp icons, which are stored in a .mbm file accompanying the .mif - both of them are required to be deployed on the device.

    If it does not help:
    How and when do you see that KErrNotFound? Are you debugging the code? Does it work in the emulator?
    Do you see the icon of your application on the device? How does it look like? A blue cube with some folding around or a puzzle piece? Or perhaps your own icon?
    What happens if you reboot the device?

  9. #9
    Registered User
    Join Date
    Jul 2009
    Posts
    18

    Re: AknIconUtils::CreateIconL() returning KErrNotFound

    Thanks I installed the mbm also and it worked!!

Similar Threads

  1. returning variables from member functions
    By diptanu in forum Symbian
    Replies: 12
    Last Post: 2008-01-28, 16:10
  2. AknIconUtils::CreateIconL returns KErrAlreadyExists
    By frobnitz in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-01-07, 06:22
  3. CCoeEnv::Static() is returning NULL pointer!
    By gwn-sameer in forum Symbian
    Replies: 2
    Last Post: 2007-11-12, 10:05
  4. RConnectionMonitor returning -1 (KErrNotFound)
    By j4y4n7 in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2007-07-18, 12:59
  5. Replies: 3
    Last Post: 2004-04-20, 16:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×