Hi,
I want to create a list box in my application. My code is as below:-I have defined the resouce in .rss file as below:-
RESOURCE LISTBOX r_listbox_timer
{
flags = EAknListBoxSelectionList | EAknListBoxViewerFlags;
array_id = r_listbox_timer_items;
}
RESOURCE ARRAY r_listbox_timer_items
{
items =
{
LBUF { txt = "Item1"; },
LBUF { txt = "Item2"; },
LBUF { txt = "Item3"; }
};
}
In View Class, i want to create the list box from resource file as below:-
void CtimerAppView::ConstructL( const TRect& aRect )
{
// Create a window for this application view
CreateWindowL();
//Ashsih list Box Addition:-starts
iListBox = new (ELeave) CAknSingleStyleListBox();
// construct listbox
iListBox->ConstructL(this);
// set container control
iListBox->SetContainerWindowL(*this);
// initialize resource reader, passing resource id as parameter
TResourceReader reader;
TInt resource_id= R_LISTBOX_TIMER; //r_demo_listbox_viewer/*R_DEMO_LISTBOX_VIEWER*/
iEikonEnv->CreateResourceReaderLC(reader,resource_id);
// load and construct the resource
iListBox->ConstructFromResourceL(reader);
CleanupStack::PopAndDestroy(); // rr
//Ashish ListBox Edition Ends
// Set the windows size
SetRect( aRect );
// Activate the window, which makes it ready to be drawn
ActivateL();
}
Compilation is okay, but wheni run my application, it crashes "App. Closed"
Can somebody help me out in resolving the problem...



