How can i convert from any descriptor eg., Tbufc,tbufc16,Hbufc8/16 to TDesc8?
| Mon, 2008-06-23 14:30 | |
|
HI all, I want to convert the file path to TDesc8.How can i do it? For eg., I have done like this , I have something like const TDesC8& aBuffer _LIT(Kbufferpath,"c:\\Media Files\\audio\\music\\goodbye"); How to do it.Please suggests me. -Vite |
|






Forum posts: 80
Hi
This thread have been discussed here many time , first you should have searched this question
Anyway
aBuffer =buffer;TBufC16 and TDesc8 are classes ,you can't act on these like data type and another thing you can only use "=" only with same class object , if the
object class has operator overloading function for "="
Now come to solution
_LIT(Kbufferpath,"c:\\Media Files\\audio\\music\\goodbye");
TBuf8<100> filepathbuf8;
CnvUtfConverter::ConvertFromUnicodeToUtf8( filepathbuf8, Kbufferpath);
Forum posts: 5
HI Praveen,
Thanks for the fast response.
I got the point what u r saying >But i have 1 function which has the argument of Const TDesC8.I need to pass a descriptor of this.ie.,
I need to convert from any descriptor to this TDesC8
void abc(Const TDesC8& aBuffer);
The filepath i need to give to TDesc8 aBuffer descriptor
How to do it?
Vite
Forum posts: 80
These are the class declaration for Symbian 8- bit descripter
class TBuf8 : public TBufBase8;
class TBufBase8 : public TDesC8 , public TDes8;
class TDes8 : public TDesC8;
Then dude , you do'nt need to convert from TBuf8 to TDesC8 OR TDes8 to TDesC8 , It is the super class for both ,Now
void abc(Const TDesC8& aBuffer);
you call this function with TBuf8 object o
TBuf8<100> buf8 ;
abc(buf8 );
try it ,if still problem post your code and error here
Thanks and regard
Praveen Kumar Sharma
Forum posts: 463
Hi vite,
http://descriptors.blogspot.com/
That contains all the info you are seeking and will make things easier for you
Good Luck