E32USER-CBASE21

Login to reply to this topic.
Thu, 2008-06-05 10:01
Joined: 2008-05-21
Forum posts: 15

hi all,

i am facing the above mentioned error.

const TDesC& CRFsEngine::FindFileName(TInt aFileNameIndex)
{
return (iFileList->operator[](aFileNameIndex).iName); // this line causes it.

}

can anyone tell me, wats wrong in it???


Thu, 2008-06-05 12:21
Joined: 2007-11-14
Forum posts: 10
Re: E32USER-CBASE21

Look up the panic in the SDK docs in future. For now, the panic is described as:
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.

Also, why go such a long winded way to invoking operator[]? The following will probably be better:

const TDesC& CRFsEngine::FindFileName(TInt aFileNameIndex)
   {
   if (aFileNameIndex >= 0 && aFileNameIndex < iFileList->Count())
      {
      return (*iFileList)[aFileNameIndex].iName;
      }
   return KNullDesC;
   }

Fri, 2008-06-06 05:15
Joined: 2008-05-21
Forum posts: 15
Re: E32USER-CBASE21

actually the problem was with the CurrentItemIndex() function i used.

insted i used MdcaPoint() n it worked alrite.

neways thanks for the help.

Punit.

  • Login to reply to this topic.