Solved

Display characters using ASCII values

Posted on 2002-04-30
4
394 Views
Last Modified: 2013-12-03
1)I want to display some characters like (pi, omega, gamma)
in controls or on a dialog itself using ASCII values.
I understand that MFC supports ANSI character set. How to make
the settings for ASCII character set support. Is it possible
to display with ASCII values using SetWindowText or some other means?

2)I have downloaded some chinese fonts. How to display these characters
again in the controls using their ASCII values.

I have VC++ 6.0 installed

Thanks in advance
Prem
0
Comment
Question by:premadhas
4 Comments
 
LVL 3

Expert Comment

by:job_s
ID: 6980496
2.

For setting the Chinnese fond
use

HFONT CreateFontIndirect(
  CONST LOGFONT* lplf   // characteristics
);
void SetFont(HFONT hFont,BOOL bRedraw = TRUE);





0
 
LVL 32

Expert Comment

by:jhance
ID: 6980497
You're talking in circles.

Characters like PI, OMEGA, and GAMMA are NOT ASCII characters.  Neither are Chinese characters.

So there is no ASCII character for these.
0
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
ID: 6980510
Hi!
1. You have to set "Symbol" font to the control whwe you want display these symbols.
2. Set this font to the control and use MBCS symbols to display chinese.
To set font to the control you have to:
1. Declare handle to this font as class member (CFont)
2. Create font in the OnInitDialog.
3. Set font to th e control by SetFont();
that is:
m_wndMyStaticControlToDisplaySymbols.SetFont(&m_fntSymbol);
0
 

Author Comment

by:premadhas
ID: 6988306
any information on how to get pixel information about those characters in the controls
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 111
maven archtype selection in eclipse 1 53
PowerPoint not providing access to all installed fonts within a family 22 234
Making an alias 7 79
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now