salem,
No. It ain't that easy. I checked all three possibilities before. CreateStatusWindow A/W.
I have seen various questions on this problem in the net ... Didn't see any satisfying answer.
Forgot to mention ... Visual studio 1900.
btw. the linkerror is LNK1120.
Salem,
MS ... "This function is obsolete. Use CreateWindow instead".
Yes, this always means: "stable function because of compability".
The function is in commctrl.h.
Of course I could use CreateWindowEx instead, but would like to know what causes the problem
I do not know nothing on c++ ... What do you mean with this ?
He's asking how exactly are you trying to build the program?
On the command line? If so, what is the command?
In an IDE? Which IDE? Did you set it up as a "console" project? Did you add any libraries to the linker settings? Presumably not since you don't seem to know what they are. Try looking for them and adding comctl32.lib.
salem c,
Of course I am using Visual Studio 2019 (not 1990), because I installed it today (my mistake).
"Why is because the symbol doesn't exist in any libraries any more.
That's what obsolete means"
That's what it usually doesn't mean if MS uses this sentence.
Like I said:
This always means: "stable function because of compatibility".
I can use CreateStatusWindow in other languages.
Of course It might be different in Visual studio 2019, but I doubt it.
But ok. ... So I use CreateWindowEx.
Have a good one !
If you're building Unicode, but supplying a char based string, Windows is not able to "understand" what is actually an "ASCII" text. It's interpreting that as Unicode, sending out what it thinks is right.
Change the char to a unicode compatible declaration, and issue the string literal as a Unicode string, not an ASCII (8 bit) character array (which is what you have now).
Windows isn't the problem here, compatibility with the configuration of the compiler is.
We all must use string literal methods (and variable declarations) compatible with the configuration of the compiler. Use a version that mutates according to configuration automatically and you're good.
It works, but the text in the window seems to be chinese.
The reason is that you send a local copy of the string to the window that does not longer exists when the function is done. Besides the problem that it might or might not the right encoding.
Which encoding you use depends also on the project setting.