you're reading...
C++, Source Code, Symbian, Technology

Symbian – TPtrC to TText* conversions

To create a TText* from a TPtrC we need to access the Ptr() function of TPtrc. Here is the sample code snippet

// Set the TPtrC
_LIT(KText , "Test Code");
TBufC<10> Buf ( KText );
TPtrC    Ptr1 (Buf);
// Get the TText *
TText * Text1 = (TText *)Ptr1.Ptr();

To Create a TPtrC using a TText* is same as that of creating a TPtrC from a TBuf either using the constructor or the Set method

TPtrC ptr(Text1);

//Set Method
TPtrC Ptr1;


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: