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):
And this is the resource: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; } ...
I hope that you can help me.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; }; } }; }
Regards,
Jonas.




