the aSelected variabe is of type TBufC16<256> and cotains iSMSMtm->Entry().Entry().iDetails from a previous view. what i am trying to do is choosing a sender from a list and then filtering the messages with the chosen sender.
my problem is that usually the code above works. it displays all the text from a certain sender. but there are a few times that it doesn't work. i tried debugging it and it seems that there are iDetails entries that cannot be compared eventhouhg the content of aSelected is an iDetail value chosen from a previous view.
in the emulator it always work. but when i try in the phone, sometimes it doesn't work.
are you sure that the problem is with the Compare() function? Maybe your problem is because some of the messages don't have a sender info in the iDetails field?
instead of comparing iDetails try to use MTM function to search for the sender:
iMtm->Find(KPhoneNumber, KMsvMessagePartOriginator)
im almost sure that the problem is with compare because all of the test data i am using has iDetails values in them.
il try to explain again what i am trying to do. im sori if my explanation wasn't very clear.
i have 2 listboxes. my 1st listbox contains all the senders of the text messages in the inbox. if mr.smith has 2 text message in the inbox, there will only be 1 mr.smith in the first listbox. if the user chooses mr.smith from the 1st listbox, the 2nd listbox should only list all the text messages from mr.smith.
the problem is there are times that eventhough the name mr.smith is listed in the 1st listbox, when i select mr.smith there will be no data for the 2nd listbox. but if i, for example, selected a certain mr.wayne from the 1st listbox, the 2nd listbox correctly displays all text messages from mr.wayne.
when i tried debugging my code, the following lines works ok.
what i mean is that in the emulator, i am able to display all the text messages from mr.smith. but when i try it in the phone, the listbox displays no data.