Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change code page to print ASCII characters in ListBox

0 views
Skip to first unread message

Ingvild Johansen

unread,
Jan 16, 2002, 5:15:59 AM1/16/02
to
I have a Visual C++ 6.0 GUI application running on a WIN2000 computer.
In a ListBox in a dialog (CDialog) I want to display lines (strings)
with numbers, underscores (ascii 95 dec.), 'semi-filled boxes' (ascii
177 dec.) and 'filled boxes' (ascii 219 dec.).

The string to be displayed is created using:
CString testStr = "";
testStr.Format("123 \x5F\xB1\xDB");

I have tried to accomplish this trying various things: setlocale(),
ListBox.SetLocale(). However, I have not been able to change the
reference code page since the corresponding characters from the ANSI
character codes chart are returned at every attempt.

Can anyone help me to find a solution?


Ingvild

Joseph M. Newcomer

unread,
Jan 27, 2002, 7:12:22 PM1/27/02
to
This is not an issue of ASCII characters (at least if you are building an 8-bit app), it
has to do with what font you have selected into the control. Underscores pose no problem;
but the character 177 is shown in my CharacterMap as a +- character, which you may see as
ą here depending on your font selection. ASCII 219 is a U with a haczek character (like a
pointing uparrow), the character Ű. If you think this should be displayed as some other
kind of character, you need to select the correct font first. You are quite possibly
confusing the "ASCII character set" with the "IBM Extended character set" which was used
on MS-DOS machines but was never an official standard. Most of the Windows fonts, except
those designed specifically to be symbolic character sets, conform to the graphic
representations of ISO-8859-1. Locales likewise have nothing to do with this, since they
select standard font sets as well (ISO-8859-2, ISO-8859-3, ISO-8859-n for various special
languages). What you probably want to do is select the "terminal" font into your control;
it supports the obsolete and non-standard IBM PC character set that was used in MS-DOS
applications.
joe

On Wed, 16 Jan 2002 11:15:59 +0100, Ingvild Johansen <Ingvild....@datarespons.no>
wrote:

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm

0 new messages