Solved

Sending a number to a control

Posted on 1998-06-29
2
168 Views
Last Modified: 2010-04-01
i want to send a number to a control for example:
int number = 50;
SetDlgItemText( hDlg, IDC_STATICTEXT1, number );
i know that wont work, so whats the right way to do it? would i convert it to char * first? if so please show me exactly how.
im using the windows api, borland c++ 5.02, and win95.
thanks.
chris
0
Comment
Question by:Vickio
2 Comments
 
LVL 1

Accepted Solution

by:
sergem earned 50 total points
ID: 1166882
char szText[255];

sprintf(szText,"%i",number);
SetDlgItemText(hDlg,IDC_STATICTEXT1,szText);
0
 

Author Comment

by:Vickio
ID: 1166883
thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

830 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