Advertisement
jack06215

[Win c++] char2LPCWSTR

Jul 8th, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3. wchar_t *char2LPCWSTR(const char* charArray)
  4. {
  5.     wchar_t* wString = new wchar_t[4096];
  6.     MultiByteToWideChar(CP_ACP, 0, charArray, -1, wString, 4096);
  7.     return wString;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement