?
Solved

display a unsigned char value in a edit control

Posted on 1998-08-07
2
Medium Priority
?
259 Views
Last Modified: 2010-04-10
i try to display a unsigned char value in a CEdit control CFormView->CEdit.SetWindowText(value);
but SetWindowText methode accept just CString typ, how can i convert this value, if value=12 user
must see in dialog 12.
if i use a CStatic control how can i slove the same problem.

                                      best regards
0
Comment
Question by:saidi
  • 2
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 400 total points
ID: 1169596
CString strText;
strText.Format(_T("%u"), (unsigned int)value);
CFormView->CEdit.SetWindowText(value);

For CStatic, it is the same since you have got the CString.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1169597
Sorry, it should have been

CString strText;
strText.Format(_T("%u"), (unsigned int)value);
CFormView->CEdit.SetWindowText(strText);

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

809 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