Advertisement
pushrbx

Convert basic_string to LPTSTR

Apr 28th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. template<typename TC> inline void ConvertStrToPtrTChar(__in std::basic_string<TC> str, __out LPTSTR &pchar)
  2. {
  3.     pchar = new TCHAR[str.size() + 1];
  4.     pchar[str.size()] = 0;
  5.     std::copy(str.begin(), str.end(), pchar);
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement