-
-
Notifications
You must be signed in to change notification settings - Fork 122
Frequently Asked Questions
In this document you can find the questions made frequently in the comments section of the various Youtube Video Tutorials and in the #questions and #ideas-and-suggestions Discord Channels of C++ 3D Game Tutorial Series
How to solve the error: a value of type const char*
cannot be assigned to an entity of type LPCWSTR
?
To solve this kind of error you've to put L
in front of your strings, like "My Window Class"
--> L"My Window Class"
.
LPCWSTR
is the same of wchar_t*
, that is a pointer to a string of UNICODE characters, and so, to use UNICODE strings,
you have to append L at the begin of the string.
This because probably UNICODE character set is settled in the project properties.
If you want to set your favourite character set, in Visual Studio go to Project, Properties,
and in Common Properties/General under the tab Project Defaults there is a property called Character Set,
here you can choose your favourite one.
However UNICODE character set is recommended.