Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Display characters using ASCII values

Posted on 2002-04-30
4
Medium Priority
?
430 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 400 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

916 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