Solved

Question about char to ASCII code  chars and display ,thanx!!!!!

Posted on 2002-04-14
1
192 Views
Last Modified: 2013-11-20
Hi,In my programing ,I have a problem.I want to convert char to chars of ASCII code.For example ,I have 'A',I want convert 'A' to '41' and display '41' in my read_only
Edit Box,
Is there any API function to do so?
Would you please show me your tips?
Any advice is appreciated much!
0
Comment
Question by:vincent_lea
1 Comment
 
LVL 8

Accepted Solution

by:
VinExpert earned 66 total points
ID: 6941034
Hi,
Try this

void CMainFrame::OnMyaltr()
{
     char chTemp = 'A';
     CString str = GetCharsFromChar(chTemp);
     AfxMessageBox(str);
}

CString CMainFrame::GetCharsFromChar(char chTemp)
{
     CString cStrs;
     cStrs.Format("%X", chTemp);
     return cStrs;
}

Here I am calling GetCharsFromChar(...) function from one of my message mapped function. Declare that function as

CString GetCharsFromChar(char chTemp);
and use it.

Try it out.
VinExpert
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

13 Experts available now in Live!

Get 1:1 Help Now