×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    7

    Multi resource files

    I have 2 resource files but I am unable to display a dialog from my 2nd resource file - it blows up on the ExecuteLD, but it does compile okay. If I display a similar dialog in my 1st resource it works fine (my 1st resource is my main app resource). The problem seems to be with accessing resources from a 2nd resource file - i know u can read data from multiple resources, but i want to construct and display a dialog not read data.

    Any ideas, here is some code:

    CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( sUserPassword );

    CleanupStack::PushL( dlg );

    dlg->ExecuteLD( R_PASSWORD_QUERY_EX1 ); (it blows up here)

    CleanupStack::Pop( dlg );

    My 2nd resource is:

    // RESOURCE IDENTIFIER
    NAME TONY // 4 letter ID

    // INCLUDES

    #include <eikon.rh>
    #include <avkon.rsg>
    #include <avkon.rh>
    #include <avkon.mbg>


    // RESOURCE DEFINITIONS

    RESOURCE RSS_SIGNATURE { }

    RESOURCE TBUF { buf="tony1"; }

    RESOURCE EIK_APP_INFO
    {
    }


    RESOURCE DIALOG r_password_query_ex1
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtQuery;
    id = EGeneralQuery;
    control = AVKON_DATA_QUERY
    {
    layout = ECodeLayout;
    label = "Enter Password";
    control = SECRETED
    {
    };
    };
    }
    };
    }

  2. #2
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    58

    Multiple Resource Files

    I've also been attempting to load resources (in my case, a menu bar) from a second resource file and have been running into problems. Specifically, I would like to make the following call to SetMenuTitleResourceId() where MENU_BAR is a properly defined menu bar resource in the second resource file.

    iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId( MENU_BAR );

    The call actually works, but I keep getting Panic CONE 14 (resource could not be found), when attempting to show the menu.

    I would have thought that the following call to AddResourceFileL() would have done the trick:

    CEikonEnv::Static()->AddResourceFileL( _L( "foo.rSC" ) );

    But this leaves with a value of -1 (0xffffffff). I'm not sure what that leave code means. I've also attempted various different fully-qualified resource file names with no success.

    Anyone else have any thoughts?

    Colin

  3. #3
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    58

    Multiple Resource Files

    After a bit more experimentation I finally got my menu loaded from the second resource. I was very close the first time. When I attempted to add the fully-qualified resource it looked something like this:

    CEikonEnv::Static()->AddResourceFileL( _L( "Z:/system/apps/Foo/Foo2.rSC" ) );

    That caused a leave -28, which I think is some type of Replace() leave issue. Not all that helpful. But it was the directory character that was the problem. The following statement worked:

    CEikonEnv::Static()->AddResourceFileL( _L( "Z:\\system\\apps\\Foo\\Foo2.rSC" ) );

    I'll admit, my bad for using a UNIX style directory structure. It would be nice, however, if the AddResourceFileL accepted both, because really we all know what I meant.

    Colin

  4. #4
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    50
    See Interface to Resource Files section in the SDK

Posting Permissions

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