TCHAR to std::string

Thread Solved

Join Date: Sep 2006
Posts: 22
Reputation: disc is an unknown quantity at this point 
Solved Threads: 1
disc disc is offline Offline
Newbie Poster

TCHAR to std::string

 
0
  #1
Mar 16th, 2007
Goodmorning,

Can anyone tell me how to convert a TCHAR to a std::string ??

Thanks....
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,407
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1468
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: TCHAR to std::string

 
0
  #2
Mar 16th, 2007
TCHAR is just a macro that is defined to be either char* or wchar_t*, depending on whether your program is compiled with UNICODE or not. If not UNICODE then use just simple assignment to convert to std::string. If the program is UNICODE then use one of the conversion functions, such as wcstombs(). That function works ok with English language, but I don't know about other languages.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 22
Reputation: disc is an unknown quantity at this point 
Solved Threads: 1
disc disc is offline Offline
Newbie Poster

Re: TCHAR to std::string

 
0
  #3
Mar 16th, 2007
Thanks Ancient Dragon, 'problem' solved....
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC