Guest User

Untitled

a guest
May 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. char* sz = "tadaaa";
  2. CreateProcessW(A2W(sz), ...);
  3.  
  4. const char* sz = "tadaaa";
  5. const CString s( sz );
  6. LPCWSTR ws = static_cast<LPCWSTR>( s ); //calling CString::operator (LPCWSTR)()const;
  7.  
  8. typedef std::basic_string<TCHAR> tstring
  9.  
  10. // Make any methods you control return tstring values. Thus, you could write:
  11. tstring command = obj.getInstallationPath();
  12. CreateProcess(x, command.c_str(), ...);
  13.  
  14. LPCWSTR string_to_LPCWSTR(const std::string& s)
  15. {
  16. std::basic_ostringstream<WCHAR> buffer;
  17. buffer << s;
  18. return buffer.str().c_str();
  19. }
Add Comment
Please, Sign In to add comment