[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2002-04-14
1
Medium Priority
?
208 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:
Vinayak Kumbar earned 198 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

872 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