×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    4

    CAknSelectionListDialog causes panic: "USER: 0".

    Hi.

    I have a little problem, I have asked Google :) and searched in this forum, but havn't found anything that have helped. So, now I'm hoping that you can give me an answer, or a hint.

    I want to create a listbox dialog, using CAknSelectionListDialog. But when I run the application I get an "USER: 0"-panic. I figured out that it crashes inside RunLD(). But I don't know what causes it.

    This is the code (it's inside a static function):
    Code:
    ...
    /**
     * @Param:  Void.
     * @Return: TInt.
     * @Access: Public.
     */
    TInt
    CContactItems::ShowAdd2GrpDialog(void)
    {
    	CAknSelectionListDialog *dlg_obj;
    	CDesCArray              *arr_obj;
    	TInt                     index;
    	TInt                     ret;
    
    		arr_obj = NULL;
    		arr_obj = new (ELeave ) CDesCArrayFlat(4);
    		if (arr_obj == NULL)
    			return(-2);
    
    		TBuf<32> buff;
    		for (index = 0; index < 4; index++) {
    			buff.Format(_L("0\tITEM_%02d"), index);
    			arr_obj->AppendL(buff);
    		}
    
    		index = 0;
    		dlg_obj = NULL;
    		dlg_obj = CAknSelectionListDialog::NewL(index, arr_obj, 0);
    		if (dlg_obj == NULL)
    			return(-1);
    
    		ret = -1;
    		dlg_obj->PrepareLC(R_LISTBOX_DLG);
    		ret = dlg_obj->RunLD();
    
    	return ret;
    }
    ...
    And this is the resource:
    Code:
    RESOURCE DIALOG r_listbox_dlg
    {
    	flags = EAknDialogSelectionList | EEikDialogFlagWait;
    	buttons = R_AVKON_SOFTKEYS_SELECT_CANCEL;
    	items = {
    		DLG_LINE {
    			type = EAknCtSingleListBox;
    			id = EListboxDlgHandle01;
    			control = LISTBOX {
    				flags = EAknListBoxSelectionList;
    			};
    		}
    	};
    }
    I hope that you can help me.
    Regards,
    Jonas.

  2. #2
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: CAknSelectionListDialog causes panic: "USER: 0".

    This is explanation for USER 0

    This panic is raised when a thread calls User::Invariant().

    Typically, User::Invariant() is called when a test for a class invariant fails, i.e. when a test which checks that the internal data of an object is self-consistent, fails.

    Check the design and implementation of your class.
    Regards,
    Shilpa Kulkarni

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

    Re: CAknSelectionListDialog causes panic: "USER: 0".

    Hi,

    You need to pass the menubar in the CAknSelectionListDialog::NewL() as the third argument.

    This menubar will be used by the dialog itself.
    RESOURCE MENU_BAR r_res_id_for_a_menubar { titles = { MENU_TITLE { menu_pane = R_AVKON_MENUPANE_SELECTION_LIST; } }; };



    Regards,

    rishiak
    Regards,

    rishiak

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    4

    Re: CAknSelectionListDialog causes panic: "USER: 0".

    Thanks for your replys.
    I tried to add a menu, as a third parameter. But it didn't work, I still get the same panic.
    Do I have to create this dialog in a special class, for instance in AppUi or a View?

  5. #5
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    58

    Re: CAknSelectionListDialog causes panic: "USER: 0".

    Hi jonas_h
    Your code looks ok to me, Did you check the id in the resourcein DLG_LINE, it should not duplicate with other control id.

    Regards,

    rishiak
    Regards,

    rishiak

  6. #6
    Regular Contributor
    Join Date
    Oct 2004
    Location
    Tokyo,Japan
    Posts
    289

    Lightbulb Re: CAknSelectionListDialog causes panic: "USER: 0".

    Hi Jonas ,

    where is this id = EListboxDlgHandle01; defined ,

    i mean this constant 'EListboxDlgHandle01'

    i was trying to execute this code pasted by you !!!


    Regards
    NEO'

  7. #7
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Braunschweig, Germany
    Posts
    345

    Re: CAknSelectionListDialog causes panic: "USER: 0".

    It might be a bit late, but maybe it is helpfule for someone who is using the search function.

    You have to use

    id = ESelectionListControl;

    instead of

    id = EListboxDlgHandle01;

    It seems CAknSelectionListDialog is looking for the predefined IDs to find the controls. If you use your own IDs, the controls cannot be found and so it is assumed that th data is corrupt.

    Bernd

Similar Threads

  1. Panic dialog - ERRRD
    By greatape in forum Symbian
    Replies: 7
    Last Post: 2007-09-16, 19:32
  2. Emulator is killed by panic:
    By Kim Ki in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2006-11-03, 14:21
  3. CEikProgressInfo & PANIC when setting wrong width and final val
    By eekisa in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-01-05, 13:26
  4. Replies: 0
    Last Post: 2004-09-24, 22:01
  5. esock panic 17
    By tinmar in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2004-03-17, 08:37

Posting Permissions

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