Solved

Sending a number to a control

Posted on 1998-06-29
2
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
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 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…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

617 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