×

Discussion Board

Results 1 to 7 of 7

Thread: Reg: convertion

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    159

    Reg: convertion

    Can any one plz tell me how to convert TBuf8 to const HBufc8...........thanks for any help.....

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Reg: convertion

    why you want to use const HBufc8 any specific reason

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

    Re: Reg: convertion

    Anyway, if you need it, just use the AllocL() from the TBuf8. Anyway it would br normal HBufC8*..

  4. #4
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Reg: convertion

    Hi,

    Was just wondering why would you want to convert to const HBufC8....

    if it is for any function call, then I would recomment changing the function to accept const TDesC8& if feasible, that is the best way to pass a non modifiable descriptor...
    Last edited by amitkankani; 2010-07-30 at 07:06. Reason: incorrect reply
    Amit Kankani
    Nokia Developer Champion

  5. #5
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    Re: Reg: convertion

    Hi if tats a function call then try this out.......

    HBufC8* param = HBufC8::NewLC(1000);
    param->Des().Append(" parameter");

    also plz check this with the "nokia champians" as im new to symbian i would go wrong sometime....thanks

  6. #6
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: Reg: convertion

    HBufC8* param = HBufC8::NewLC(1000);
    param->Des().Append(" parameter");
    Why hardcode 1000 ? one can always take the length of the descriptor to be copied (of course, keeping in mind the MAX length needed)
    Amit Kankani
    Nokia Developer Champion

  7. #7
    Regular Contributor
    Join Date
    May 2010
    Posts
    413

    Re: Reg: convertion

    Quote Originally Posted by amitkankani View Post
    Why hardcode 1000 ? one can always take the length of the descriptor to be copied (of course, keeping in mind the MAX length needed)
    Ya u r rte....amit actually i used this convertion for callin a function for me the length to be copied is lil bit more so i used 1000 to be in safer side... thanks...

Similar Threads

  1. 3GP to AVI convertion
    By basbosaNo in forum Streaming and Video
    Replies: 1
    Last Post: 2009-02-15, 08:39
  2. Mp3 to PCM convertion
    By rkckolla in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-05-26, 12:24
  3. convertion problem
    By zikman23 in forum Symbian
    Replies: 1
    Last Post: 2005-01-23, 20:27
  4. convertion between TDes8 and TInt
    By liying in forum Symbian
    Replies: 4
    Last Post: 2004-04-27, 10:35
  5. convertion mpg to 3gp
    By siluetcomix in forum Symbian
    Replies: 1
    Last Post: 2004-02-29, 10:12

Posting Permissions

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