CreateWindowEx CBS_DROPDOWNLIST list items show up as pipe (|) characters instead of Russian

221 views
Skip to first unread message

msti...@gmail.com

unread,
Jun 5, 2012, 1:25:19 PM6/5/12
to
I created a drop down list with two Russian language strings using CSB_DROPDOWNLIST. The strange thing is that when the static text is displayed, you can see the Russian characters fine, but when you click to drop down the list, they all show up as pipe characters (i.e. ||||||| instead of прерванные). See example here: https://picasaweb.google.com/lh/photo/HLKDB1ZcK4_9YpgcZCuc2d5BgnHv85NhJtgGKZATaEE?feat=directlink.

Note that if I set it to Chinese or Korean, etc., I don't have this problem. Those Asian characters show up without issue.

Anyone else experience a similar problem before?

Below are the only two calls I make to create/update this control on initialization:

const HWND hwndComboBox = ::CreateWindowEx(
0,
WC_COMBOBOX,
TEXT(""),
CBS_DROPDOWNLIST | CBS_SIMPLE | WS_CHILD | WS_VSCROLL,
uX,
uY,
uWidth,
uHeight,
m_hWnd,
reinterpret_cast<HMENU>(m_uNumberOfControls),
m_hUserControlsModule,
0);

lResult = ::SendMessage(hwndComboBox, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(szItem));

David Lowndes

unread,
Jun 5, 2012, 2:47:30 PM6/5/12
to
>I created a drop down list with two Russian language strings using CSB_DROPDOWNLIST. The strange thing is that when the static text is displayed, you can see the Russian characters fine, but when you click to drop down the list, they all show up as pipe characters (i.e. ||||||| instead of ??????????). See example here: https://picasaweb.google.com/lh/photo/HLKDB1ZcK4_9YpgcZCuc2d5BgnHv85NhJtgGKZATaEE?feat=directlink.
>
>Note that if I set it to Chinese or Korean, etc., I don't have this problem. Those Asian characters show up without issue.

Which versions of Windows have you tried this on?
Is the issue consistent with XP, Vista, & 7?

Dave

Tina Wu

unread,
Jun 5, 2012, 4:48:41 PM6/5/12
to
Yes, the issue is consistent on XP and 7. Note that if I change the Windows locale to Russian, this problem goes away.

David Lowndes

unread,
Jun 5, 2012, 6:34:06 PM6/5/12
to
>Yes, the issue is consistent on XP and 7. Note that if I change the Windows locale to Russian, this problem goes away.

Does the font you use for the control make any difference?

It sounds like the list portion of the combo is perhaps choosing a
different font from the static control - but I don't know why it
should.

If you can create a simple example project that reproduces the issue,
I suggest that you try to report it to MS and supply them with the
sample.

Dave

Tina Wu

unread,
Jun 6, 2012, 3:29:39 PM6/6/12
to
I don't set the fonts. I suppose it is using the default system fonts. It would be a bit strange, though, if the font being used to display the static text was different than that of what is contained in the list box.

I'll try a simple sample project to reproduce this issue.

Tina Wu

unread,
Jun 8, 2012, 1:53:57 PM6/8/12
to
So I ended up just creating a font "Arial Unicode MS" that is a supposed universal font to use for most/all languages character sets and I applied that font to this combobox only. That seems to have fixed the problem. Strange.
Reply all
Reply to author
Forward
0 new messages