First you could get users input as wchar_t*
instead of char*
. I think it would be the best option.
LPCWSTR
is a pointer to wide char array, so you need to convert every char
to wchar_t
.
So lets say you have:
char arr[] = "Some string";
So your actions:
size_t size = strlen(arr);
wchar_t* wArr = new wchar_t[size];
for (size_t i = 0; i < size; ++i)
wArr[i] = arr[i];
And if you need LPCWSTR
you just use &wArr[0]
(or some other index).
Important: don't forget to deallocate memory.