944,085 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 13471
  • C RSS
Mar 16th, 2007
0

TCHAR to std::string

Expand Post »
Goodmorning,

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

Thanks....
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
disc is offline Offline
29 posts
since Sep 2006
Mar 16th, 2007
0

Re: TCHAR to std::string

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,957 posts
since Aug 2005
Mar 16th, 2007
0

Re: TCHAR to std::string

Thanks Ancient Dragon, 'problem' solved....
Reputation Points: 10
Solved Threads: 1
Light Poster
disc is offline Offline
29 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Can someone post something using Win32 and MySQL++?
Next Thread in C Forum Timeline: Signal error from mathematical operation in C





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC