Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending a number to a control

Posted on 1998-06-29
2
Medium Priority
?
174 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

721 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