×

Discussion Board

Results 1 to 6 of 6

Thread: RPointerArray

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    RPointerArray

    Hi
    I created a database , in taht i am able to insert, retrive the data.

    The retrived data is in HBuf . Is it possible to put those HBuf values to RPointerArray and how.

    Plz Help


    Regards

    Deepa

  2. #2
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: RPointerArray

    Hi
    My code is

    {

    RPointerArray<CContactDetails> iBlockList;
    CleanupResetAndDestroyPushL( iBlockList );
    TInt i=0;
    HBufC* iValue1;
    //TDesC* iValue1;

    _LIT(KSQLQuery, "SELECT field1,field2,field3 FROM mytable ORDER BY field1");
    this->view->Prepare((*(this->database)), TDbQuery(KSQLQuery));
    this->view->EvaluateAll();
    for (this->view->FirstL();this->view->AtRow();this->view->NextL())
    {
    // retrieve the row
    this->view->GetL();
    // while the rowset is on this row, can use a TPtrC to
    // refer to any text columns
    iValue1 = this->view->ColDes16(1).AllocL();
    TBuf<50> temp(iValue1->Des());
    this->iBlockList.AppendL(iValue1);

    CleanupStack::Pop( iValue1 );

    i++;
    }



    and i am getting the error in the line

    this->iBlockList.AppendL(iValue1);

  3. #3
    Super Contributor
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: RPointerArray

    Quote Originally Posted by Deepa msc View Post
    Hi
    My code is

    {

    RPointerArray<CContactDetails> iBlockList;
    CleanupResetAndDestroyPushL( iBlockList );
    TInt i=0;
    HBufC* iValue1;
    //TDesC* iValue1;

    _LIT(KSQLQuery, "SELECT field1,field2,field3 FROM mytable ORDER BY field1");
    this->view->Prepare((*(this->database)), TDbQuery(KSQLQuery));
    this->view->EvaluateAll();
    for (this->view->FirstL();this->view->AtRow();this->view->NextL())
    {
    // retrieve the row
    this->view->GetL();
    // while the rowset is on this row, can use a TPtrC to
    // refer to any text columns
    iValue1 = this->view->ColDes16(1).AllocL();
    TBuf<50> temp(iValue1->Des());
    this->iBlockList.AppendL(iValue1);

    CleanupStack::Pop( iValue1 );

    i++;
    }



    and i am getting the error in the line

    this->iBlockList.AppendL(iValue1);
    which error you are getting just check this by using TRAPD.
    and try this
    HBufC8* iValue1= HBufC8::NewL(size);
    CleanupStack::PushL(iValue1);
    TPtr8 iData(iValue1->Des());
    iData.Copy(temp);
    this->iBlockList.AppendL(iData);
    Regards
    $-Nitesh-$

  4. #4
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: RPointerArray

    Quote Originally Posted by Nitesh Bhardwaj View Post
    which error you are getting just check this by using TRAPD.
    and try this
    HBufC8* iValue1= HBufC8::NewL(size);
    CleanupStack::PushL(iValue1);
    TPtr8 iData(iValue1->Des());
    iData.Copy(temp);
    this->iBlockList.AppendL(iData);


    Hi


    but i am getting the same error
    i.e
    No matching function for call to RPointerArray<CContactDetails>::AppendL(TPtr8 &)'

  5. #5
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: RPointerArray

    iData.Copy(temp);

    Can u plz tell me what actually the temp is

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: RPointerArray

    BTW, if your pointer array is for type CContactDetails, why are you appending HBufC in there ?

    Should you change your pointer array to be for HBufC type pointers, or should you instead append pointers to CContactDetails ?

Similar Threads

  1. RArray vs. RPointerArray
    By johngoche in forum Symbian
    Replies: 1
    Last Post: 2006-11-08, 05:27
  2. RPointerArray and leaving
    By Kebab300 in forum Symbian
    Replies: 4
    Last Post: 2006-02-06, 01:30
  3. RPointerArray of function pointers?????
    By GonzoCubFan in forum Mobile Java General
    Replies: 0
    Last Post: 2005-11-02, 18:47
  4. RPointerArray value assignment
    By zhengyu97 in forum Symbian
    Replies: 2
    Last Post: 2005-04-06, 12:35
  5. RPointerArray Insertion and Access
    By Vextorin in forum Symbian
    Replies: 2
    Last Post: 2004-07-07, 20:26

Posting Permissions

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