Solved

display a unsigned char value in a edit control

Posted on 1998-08-07
2
245 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 100 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

759 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

18 Experts available now in Live!

Get 1:1 Help Now