×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Feb 2004
    Posts
    51

    Compare() works in emulator but doesn't work in phone

    hi.

    i have the following lines in my code:

    TBufC16<256> iTemp2 = iSMSMtm->Entry().Entry().iDetails;

    if ( aSelected.Compare(iTemp2) == 0)
    {
    aDescriptorList.AppendL(iSMSMtm->Entry().Entry().iDetails);
    aDescriptorList.AppendL(iSMSMtm->Entry().Entry().iDescription);
    }
    .
    .
    .

    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.

    any ideas what i am missing? thanks!

    yen

  2. #2
    Registered User
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    25
    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)

    hope it helps

  3. #3
    Regular Contributor
    Join Date
    Feb 2004
    Posts
    51
    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.

    TBufC16<256> iTemp2 = iSMSMtm->Entry().Entry().iDetails;

    if ( aSelected.Compare(iTemp2) == 0)
    {
    aDescriptorList.AppendL(iSMSMtm->Entry().Entry().iDetails);
    aDescriptorList.AppendL(iSMSMtm->Entry().Entry().iDescription);
    }
    .
    .
    .


    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.

    i hope somebody can help me on this. thanks!

    yen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×