I have a Visual Studio 2019 C++ project that has this definition in one header file:
static const PWSTR s_rgComboBoxStrings[] =
{
L"First",
L"Second",
L"Third",
};
In that case, this error is shown:
a value of type "const wchar_t *" cannot be used to initialize an entity of type "const PWSTR"
Why is that? if I use PCWSTR
instead of const PWSTR
it compiles, but the problem is that I have the same problem in Windows SDK .h files so it not a good idea to modify windows .h files.
Curiously, I have other project that has exact the same definition (since I just copied and pasted the code), and that project compiles perfectly.
I have compared the project settings but it seems they are all the same.
I have thought about copied all the project files and then rename the files and change it according to my own project requirements, but I want to find out what is the problem with this project first.
Regards Jaime