×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    12

    How to use TBuf with TPtr

    Hello All,
    How can i use the value of TBuf with TPtr. I have the code

    void CMobileDialerSettingItemListView::HttpBodyReceived(const TDesC8& msg)
    {
    TUint8 registerip[100] = {0};
    TPtr8 cRegisterIp(registerip, sizeof(registerip));
    cRegisterIp.Copy(msg); /
    }

    How can i use the TBuf in place of TUint. i want to assign(copy) the char value in cRegisterIp.

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

    Re: How to use TBuf with TPtr

    have you tried just using TBuf8<100> there ?

    also see wiki for converting between char & descriptors: http://developer.nokia.com/Community...and_Vice_Versa

  3. #3
    Registered User
    Join Date
    Jun 2013
    Posts
    12

    Re: How to use TBuf with TPtr

    i am doing
    TBuf8<100> registerip;
    TPtr8 cRegisterIp(registerip);
    CRegisterIp.Copy(msg);

    But it is taking only TPtrC8 not TPtr8. What should i do?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to use TBuf with TPtr

    You may want to describe what you want from this method. 8-bit descriptor types have almost equivalent features, so passing around 'msg' seems a bit pointless.
    But it is taking only TPtrC8 not TPtr8.
    What do you refer to when writing 'it'?

Similar Threads

  1. When to use a TPtr& as a parameter
    By Potassium in forum Symbian
    Replies: 3
    Last Post: 2012-04-04, 10:37
  2. Some questions about TBuf and TPtr
    By logan04x in forum Symbian
    Replies: 9
    Last Post: 2009-01-07, 05:17
  3. Replies: 6
    Last Post: 2007-06-19, 10:54
  4. how to convert TPtr, TBuf, TDes to TInt?
    By ipis in forum Symbian
    Replies: 2
    Last Post: 2005-11-08, 09:05
  5. How to convert type TPtr to type TBuf?
    By yfzfq in forum Symbian
    Replies: 1
    Last Post: 2004-06-02, 10:50

Posting Permissions

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