coder777 wrote: |
---|
for now I'd suggest to change the project setting from the default UNICODE to ANSI. |
Do not do this. Instead... you should use the proper string types for whatever function you're calling.
CreateWindow takes
TCHAR
strings. Not wide chars, and not narrow chars... but TCHARs.
Likewise... putting the 'L' before a string literal makes it wide... but
does not necessarily make it a TCHAR so that is not the correct solution either.
If you are not using TCHARs, you should not be using CreateWindow. It's that simple. Changing the project setting as coder777 is suggesting is side-stepping the problem.
Since you are using narrow strings, you should use the narrow string version of the function:
CreateWindowA
1 2 3
|
CreateWindow // <- takes TCHAR strings (LPCTSTR)
CreateWindowA // <- takes char strings (LPCSTR)
CreateWindowW // <- takes wchar_t strings (LPCWSTR)
|
Practically all other WinAPI structs/functions operate the same way (MessageBoxA, CreateFileA, etc)
do not mix and match. If you have char strings, call the 'A' functions. Do not call the "normal" version unless you have TCHAR strings.