For Programmers: Free Programming Magazines  


Home > Archive > VC Language > November 2005 > Re: convert TCHARto string









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: convert TCHARto string
ama

2005-11-27, 7:04 pm


"Maileen"
> I'm starting to be crazy.... ;-(
> i'm not successful to convert a simple TCHAR[] to string
>
> Could someone help me please ?
>
> i tried to pass through a simple pointer...it does not work.
> i tried to pass through a simple copy to string, it does not work...
>
> thanks a lot,
>
> Maileen


You'd need to post what you tried so we can have
an idea of what you're doing.

Also , You should know that :

If _UNICODE is defined, TCHAR is a WCHAR.
Otherwise it's a char.

In other words if _UNICODE isnt defined, you get ;
typedef char TCHAR;

If you're using ATL you have :

USES_CONVERSION;
string s = W2A(ws);

where ws is a TCHAR string.






Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com