newlc.com
Articles Only
Forum Only
Community
World-Wide Web
Home
News
Tutorials
Reviews
Downloads
Professional Services
Forums
Newsletter
Blog
About us
Last forum posts
Home
::
Forums
::
Development
::
Symbian C++
User login
Username:
*
Password:
*
Create new account
Request new password
Featured pages
Configure your PC for Symbian development
Getting started with Symbian development
Symbian OS Error Codes
Common products UIDs
Nokia S60 SDK
Featured Software
NlMakesis
Y-Browser
Y-Tasks
Active users (last 30 days)
User
Score
Andreas
52
eric
46
rbrunner
42
alh
40
ash_leo
26
more
Feeds
More feeds...
how to convert TBuf8 to TDesC
Login
to reply to this topic.
Tue, 2005-02-01 08:33
rahulchavan_2000
Joined: 2005-01-19
Forum posts: 46
hi there,
i m begginer in symbian,
i m trying to read the file & display the contents into a edwin control
but the problem is file contents r return in TBuf8 format & the edwin accept text in TDesC fromat
i tried but i m not able to do that
can anyone help
RaHuL
Login
or
register
to post in forums
Tue, 2005-02-01 08:47
kurtrips
Joined: 2005-01-31
Forum posts: 122
how to convert TBuf8 to TDesC
I am not very sure about this but I think there is Copy function in TDesC or TDes which takes a TDes8 as parameter. That should do it.
 
Tue, 2005-02-01 11:10
didster
Joined: 2004-07-28
Forum posts: 1379
how to convert TBuf8 to TDesC
There is an artical on new LC on the numerious ways to convert 8 to 16 bit descriptors. Goes something like this:
TBuf8<10> buf8 = ...;
TBuf<10> buf16;
buf16.Copy(buf8);
Thats one way - only if you know at build time the lengh of the string. The other way being to use a HBufC:
TBuf8<10> buf8 = ...;
HBufC* buf16 = HBufC::NewLC(buf8.Length());
buf16->Des().Copy(buf8);
CleanupStack::PopAndDestory(buf16);
didster
 
Login
to reply to this topic.
Forum posts: 122
Forum posts: 1379
TBuf8<10> buf8 = ...;
TBuf<10> buf16;
buf16.Copy(buf8);
Thats one way - only if you know at build time the lengh of the string. The other way being to use a HBufC:
TBuf8<10> buf8 = ...;
HBufC* buf16 = HBufC::NewLC(buf8.Length());
buf16->Des().Copy(buf8);
CleanupStack::PopAndDestory(buf16);
didster