×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    27

    Convert TBuf8 to TBufC16

    hi,everybody,
    I want to convert Tbuf8<12> iGB to TBufC16<20> iUin;
    I know iUni.Copy(iRealbuffer->Des()) can convert TBufC8 to TBufC16 ;(if iRealbuffer is a TBufC8 class ), if I use this way ,But how can I convert TBuf8 to TBufC8?
    Thanks anybody give me a hand!

    zhang

  2. #2
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: Convert TBuf8 to TBufC16

    Get the TPtr8 of your contant buffer: TBufC8:es().

  3. #3
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: Convert TBuf8 to TBufC16

    Quote Originally Posted by zhang2008
    hi,everybody,
    But how can I convert TBuf8 to TBufC8?
    Thanks anybody give me a hand!

    zhang
    hi,

    You can construct TBufC8 like this

    TBuf8<20> temp8;
    temp8.Copy(_L8("vasantpatel"));
    TBufC8<20> tempC8(temp8);

    Regards,
    Vasant.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Convert TBuf8 to TBufC16

    Why do you exactly need to convert TBuf8 to TBufC8?
    If it is meant to be used as a method argument, you should rather use TDesC8, the common superclass of all 8-bits descriptors.

Similar Threads

  1. how to convert from Hbuf --> Tbuf8
    By AllyMac in forum Symbian
    Replies: 6
    Last Post: 2009-05-27, 09:22
  2. Convert TPtr16 to TBuf8
    By jend_rommel in forum Symbian
    Replies: 1
    Last Post: 2006-02-28, 17:11
  3. how to convert TReal32 to TBuf8
    By zikman23 in forum Symbian
    Replies: 3
    Last Post: 2005-01-20, 12:43
  4. convert a TDes to TBuf8
    By kcome in forum Symbian
    Replies: 1
    Last Post: 2003-05-27, 19:42
  5. convert a TDes to TBuf8
    By kcome in forum Symbian
    Replies: 3
    Last Post: 2003-05-26, 09:41

Posting Permissions

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