Skip to content

Instantly share code, notes, and snippets.

@jsxinvivo
Created October 6, 2015 13:18
Show Gist options
  • Save jsxinvivo/11f383ac61a56c1c0c25 to your computer and use it in GitHub Desktop.
Save jsxinvivo/11f383ac61a56c1c0c25 to your computer and use it in GitHub Desktop.
convert char* to LPCWSTR
wchar_t *convertCharArrayToLPCWSTR(const char* charArray)
{
wchar_t* wString=new wchar_t[4096];
MultiByteToWideChar(CP_ACP, 0, charArray, -1, wString, 4096);
return wString;
}
@binaryfox0
Copy link

binaryfox0 commented Aug 2, 2022

It works very well
Thanks

@chuaschinai
Copy link

Works nice, ty!

@vivek0626
Copy link

thnq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment