×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Sep 2006
    Posts
    280

    E32User Cbase 21

    Hi,

    I have a CAknDoubleGraphicStyleListBox listbox.
    I read from a file and then depending on whether the entry is present in the array or not, process it accordingly.

    Here is what my code looks like:

    CDesCArray* textArray = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
    TFileText filelist;
    filelist.Set(iFile);

    TBuf<256> imagename;
    TBuf<256> fileString;
    TInt index;
    filelist.Seek(ESeekStart);

    while(KErrEof != (filelist.Read(imagename)))
    {
    if(imagename.Length())
    {
    TParse parse;
    parse.Set(imagename,NULL,NULL);

    fileString.Zero();
    fileString.Append(_L ("1\t"));
    fileString.Append(parse.NameAndExt());
    fileString.Append(_L("\t \t"));
    TInt error = textArray->Find(fileString,index);
    if((!error) && (index >=0) && (index < textArray->Count()))
    {
    fileString.Zero();
    fileString.Append(_L ("0\t"));
    fileString.Append(parse.NameAndExt());
    fileString.Append(_L("\tOn Server\t"));
    textArray->Delete(index);
    iListBox->HandleItemRemovalL();

    textArray->InsertL(index, fileString);
    iListBox->HandleItemAdditionL();
    --iSelected;
    }
    else
    {
    fileString.Zero();
    fileString.Append(_L ("1\t"));
    fileString.Append(parse.NameAndExt());
    fileString.Append(_L("\tOn Server\t"));
    error = textArray->Find(fileString,index);
    if((!error) && (index >=0) && (index < textArray->Count()))
    {
    fileString.Zero();
    fileString.Append(_L ("0\t"));
    fileString.Append(parse.NameAndExt());
    fileString.Append(_L("\tOn Server\t"));
    textArray->Delete(index);
    iListBox->HandleItemRemovalL();
    textArray->InsertL(index, fileString);
    iListBox->HandleItemAdditionL();
    --iSelected;
    }
    }
    imagename.Zero();
    }
    }

    But as soon as this function is called my Emulator Crashes with E32 User Cbase 21. The problem is it doesnt crash for the first time.
    The second time I call this function for uploading it results in a crash.
    Any pointers will be of great help.

    Regards.

  2. #2
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: E32User Cbase 21

    hi,

    This is the panic description for ur error

    21
    This panic is raised by any operation which accesses an element of an array by explicit reference to an index number, for example, the Delete(), InsertL() and At() member functions or the operator Operator[]. It is caused by specifying an index value which is either negative or is greater than or equal to the number of objects currently within the array.

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  3. #3
    Regular Contributor
    Join Date
    Sep 2006
    Posts
    280

    Re: E32User Cbase 21

    I tried commenting the parts with call to delete and insert.
    But still it crashes.

  4. #4
    Regular Contributor
    Join Date
    Sep 2006
    Posts
    280

    Re: E32User Cbase 21

    Thanks.
    Solved it.
    Actually was updating an array and using some other array.

Similar Threads

  1. Error E32USER - CBase 21
    By PankajNeve in forum Symbian
    Replies: 10
    Last Post: 2007-11-27, 10:18
  2. What time in our application i use cbase
    By pistha in forum Symbian
    Replies: 1
    Last Post: 2006-09-18, 06:37
  3. Problem with inheritance (CBase)
    By julppoupou in forum Symbian
    Replies: 2
    Last Post: 2005-08-01, 07:45
  4. program closed ERROR: E32USER Cbase 63
    By jha_pankaj18 in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-05-12, 20:17
  5. Replies: 0
    Last Post: 2003-02-27, 20:28

Posting Permissions

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