Using unicode strings in Comboxboxex with Win32 API C problem
Posted on 2002-05-08
Hello again, Experts!
I have a problem with the comboboxex using C Win32 API.
The comboboxex contains unicode strings (Chinese, Thai,Japanese,etc.)
Whenever I send CB_SELECTSTRING or CB_FINDSTRING to the comboboxex window with a unicode
string I get the index found as zero, even though there is a matching first character in the listbox(of the comboboxex).
Using a WCHAR buffer as destination, the strings extracted from the listbox(of comboboxex) with CB_GETSTRING are non-unicode!! Though the comboboxex displays the strings in its listbox as unicode!
Sending a CBEM_SETUNICODEFORMAT does nothing.
comboboxex listbox: (xxx denotes non-English characters)
unicode string to find: "C"
CB_SELECTSTRING/CB_FINDSTRING returns 0!!!
with WCHAR destination buffer, CB_GETLBTEXT returns non-unicode strings! The non-English characters become ??? in memory.
Are there preliminary steps needed before CB_SELECTSTRING/CB_FINDSTRING so that the comboboxex will return the right index?
Are there preliminary steps needed before CB_GETLBTEXT so that the comboboxex will return Unicode strings?
If so, what are they?
Any help / tips/ code are appreciated!! Thanks in advance!