Hi, all.

I see that there are numerous posts here about listboxes, but none of them seem to solve my problem.

I'm trying to construct a listbox using a resource file, but my application crashes during construction of the resource. I just can't seem to figure out why. Tried everything just as the samples show. I think.

My code:

void CTBGuiContainerCall::ConstructL(const TRect& aRect)
{
CreateWindowL();

iCallListBox = new (ELeave)CAknSingleStyleListBox;
//iCallListBox -> ConstructL( this );

TResourceReader reader;
CEikonEnv::Static() -> CreateResourceReaderLC( reader, R_TBGUI_CALL_MENU );
iCallListBox -> ConstructFromResourceL( reader );
iCallListBox -> SetContainerWindowL( *this );
CleanupStack::PopAndDestroy();


iCallListBox->ActivateL();
SetRect( aRect );
ActivateL();
}

The resource:

//----------------------------------------------------
//
// r_tbgui_call_menu
//
//----------------------------------------------------
//
RESOURCE LISTBOX r_tbgui_call_menu
{
array_id = r_tbguilist_item_call;
flags = EAknListBoxSelectionList;
}


//-----------------------------------------------------------------------------
//
// r_tbguilist_item_call
// Items array for ListBox( Double )
//
//-----------------------------------------------------------------------------
//
RESOURCE ARRAY r_tbguilist_item_call
{
items =
{
LBUF
{
txt = qtn_akncalllist_on_hold;
},
LBUF
{
txt = qtn_akncalllist_patch_blind;
}
};
}


----

The code compiles, but when I try to run it in the emulator, it just terminates. If I comment out everything about the resource-construction, and just calls ConstructL() on the listbox, it works.
If I debug the code in CodeWarrior, I get to the CreateResourceReaderLC-call.

Anynone know what is the deal, here?

Thanks,
Lars