How to convert HBufC to TBuf ???

Login to reply to this topic.
Sat, 2007-07-21 17:59
Joined: 2007-06-20
Forum posts: 93

Hi,
How to convert HBufC to TBuf ? anybody guide that...........


Thanks & Regards,
C Singh


Sat, 2007-07-21 19:14
Joined: 2003-09-22
Forum posts: 27
Re: How to convert HBufC to TBuf ???

here is an example

const TInt KLength=200;//sample length
HBufC* buf=HBufC::NewLC(256);
// .... add some text to buf

TBuf<256> tbuf(*buf);

//..

CelanupStack::PopAndDestroy(buf);

Note that you should be careful with the lengths - make sure that the length of the Hbuf string does not exceed that of the TBuf.

Sun, 2007-07-22 07:24
Joined: 2007-06-20
Forum posts: 93
Re: How to convert HBufC to TBuf ???

Thanks Brian... its work fine


Thanks & Regards,
C Singh

  • Login to reply to this topic.