Hi All,
I am developing an application in that panic e32 user cbase21 arises .In my application I am using list box.While handelling list box event only item at index 0 is accessible when click on other item index panic occurs.I am developing application in s60 5th edition sdk.
my code is...
please help me ASAP....Code:iListBox = new (ELeave) CAknDoubleLargeStyleListBox(); // Construct listbox iListBox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling ); iListBox->SetContainerWindowL( *this ); // Set scrollbars iListBox->CreateScrollBarFrameL( ETrue ); iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto ); // Create listbox item array iListBoxItems = new (ELeave) CDesCArrayFlat(6); // Create listbox items iListBoxItems->AppendL( _L("0\titem0\t") ); iListBoxItems->AppendL( _L("1\titem1\t") ); iListBoxItems->AppendL( _L("2\titem2\t") ); iListBoxItems->AppendL( _L("3\titem3\t") ); iListBoxItems->AppendL( _L("4\titem4\t") ); iListBoxItems->AppendL( _L("5\titem5\t") ); // Add items to listbox iListBox->Model()->SetItemTextArray( iListBoxItems ); // Listbox deletes the item array iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray ); iListBox->HandleItemAdditionL( ); //To get event in HandleListBoxEventL() //Do not forgot to add it.......... iListBox->SetListBoxObserver(this); // Add icons to listbox AddListboxIconsL(); // Activate Listbox iListBox->SetRect( Rect() ); iListBox->ActivateL(); In HandleListBoxEventL function.... if ( aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked) { TInt Index = iListBox->CurrentItemIndex(); switch (Index) { case 0: { CAknInformationNote* informationNote; informationNote = new ( ELeave ) CAknInformationNote; informationNote->ExecuteLD(_L("item0 Selected")); } break; case 1: CAknInformationNote* informationNote; informationNote = new ( ELeave ) CAknInformationNote; informationNote->ExecuteLD(_L("index1 Selected")); break; case 2: CAknInformationNote* informationNote2; informationNote2 = new ( ELeave ) CAknInformationNote; informationNote2->ExecuteLD(_L("index2 Selected")); break; case 3: CAknInformationNote* informationNote3; informationNote3 = new ( ELeave ) CAknInformationNote; informationNote3->ExecuteLD(_L("index3 Selected")); break; case 4: CAknInformationNote* informationNote4; informationNote4= new ( ELeave ) CAknInformationNote; informationNote4->ExecuteLD(_L("index4 Selected")); break; case 5: CAknInformationNote* informationNote5; informationNote5 = new ( ELeave ) CAknInformationNote; informationNote5->ExecuteLD(_L("index5 Selected")); break; default: // Do default handling here… CAknInformationNote* informationNote1; informationNote1 = new ( ELeave ) CAknInformationNote; informationNote1->ExecuteLD(_L("default Selected")); break; } }
Thanx...




