Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 07:36, 7 January 2008.

Converting Descriptor to Char and Char to Descriptor

From Forum Nokia Wiki

Converting Descriptor to Char*

TBuf8 <200> fromBuf;
 
char*  toChar;
  • First Way
Mem::Copy((char*)toChar,fromBuf.Ptr(),fromBuf.Length() );
  • Second way
tochar = NULL;
tochar = (char *) malloc(fromBuf.Length()+1);
TInt index = 0;
for(index =0 ; index < fromBuf.Length(); index++)
{
  toChar[index] = fromBuf[index];
}
toChar[index] = 0;  //toChar contains the content

Converting Char* to Descriptor

TBuf8<200> toBuffer;
char* fromChar;
  • First Way
TPtrC8 tempPtr8((TUint8 *)(fromChar));
HBufC* toBuffer = HBufC::NewLC(tempPtr8.Length());
toBuffer->Des().Copy(tempPtr8);     // toBuffer contains the  content
  • Second way
toBuffer.Copy(fromChar);

Note :- here basic conversion between Char and Buffer is given for conversion between different descriptors in symbian refer to this link

Conversion between Descriptors

Related Discussions
Thread Thread Starter Forum Replies Last Post
when to use short, byte, and int 3hrguy Mobile Java General 9 2004-05-28 11:40
CAknQueryDialog prompt tstiemer Symbian User Interface 3 2003-12-21 14:31
8-bit namak General Symbian C++ 2 2008-02-11 17:11
descriptor seperator sandy_zeng General Symbian C++ 1 2007-11-25 15:45
Problem with sending image ckt General Symbian C++ 5 2007-01-03 08:27
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX