I can't find a solution to read one Item from CDesCArray *itemList.
Here is one method what i've tried, but result is KERN-EXEC 3 in the if- statement.
Is there anyone there who can help me find a better working solution.
My Code:
void CDialogQueryAppView::SetDialogTest(){
TInt index( 0 );
CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( &index );
// construct listbox item array
CDesCArray* itemList = new (ELeave) CDesCArrayFlat(3);
_LIT( KFirst, "1st Item" );
_LIT( KSecond, "2nd Item" );
_LIT( KThird, "3rd Item" );
HBufC* item = HBufC::NewL(20);
*item = KFirst;
itemList->AppendL(*item);
*item = KSecond;
itemList->AppendL(*item);
*item = KThird;
itemList->AppendL(*item);
dlg->PrepareLC( R_AVKON_LIST_QUERY );
dlg->SetItemTextArray( itemList );
if( dlg->RunLD()){
// ok pressed, index is the selected item index.
*item = (*itemList)[index];
iEikonEnv->InfoMsg( *item );
}
delete item;
}
-Desperately seeking

Reply With Quote

