Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MessageBox vs AfxMessageBox Pin
Jens Joseph21-Feb-11 0:05
Jens Joseph21-Feb-11 0:05 
GeneralRe: MessageBox vs AfxMessageBox Pin
Hans Dietrich21-Feb-11 0:28
mentorHans Dietrich21-Feb-11 0:28 
AnswerRe: MessageBox vs AfxMessageBox Pin
Andrew Brock21-Feb-11 0:30
Andrew Brock21-Feb-11 0:30 
Questionhow to use arguments Control in another class Pin
so0_lanhlung220-Feb-11 23:09
so0_lanhlung220-Feb-11 23:09 
AnswerRe: how to use arguments Control in another class Pin
Hans Dietrich20-Feb-11 23:40
mentorHans Dietrich20-Feb-11 23:40 
GeneralRe: how to use arguments Control in another class Pin
so0_lanhlung221-Feb-11 1:46
so0_lanhlung221-Feb-11 1:46 
AnswerRe: how to use arguments Control in another class Pin
Andrew Brock20-Feb-11 23:50
Andrew Brock20-Feb-11 23:50 
GeneralRe: how to use arguments Control in another class Pin
so0_lanhlung221-Feb-11 1:47
so0_lanhlung221-Feb-11 1:47 
QuestionCFileDialog Pin
john563220-Feb-11 22:16
john563220-Feb-11 22:16 
AnswerRe: CFileDialog Pin
_AnsHUMAN_ 20-Feb-11 22:24
_AnsHUMAN_ 20-Feb-11 22:24 
AnswerRe: CFileDialog Pin
Hans Dietrich20-Feb-11 23:44
mentorHans Dietrich20-Feb-11 23:44 
Questionuse of HitTest method Pin
sarfaraznawaz20-Feb-11 18:39
sarfaraznawaz20-Feb-11 18:39 
AnswerRe: use of HitTest method Pin
Cool_Dev20-Feb-11 19:27
Cool_Dev20-Feb-11 19:27 
GeneralRe: use of HitTest method Pin
sarfaraznawaz20-Feb-11 19:44
sarfaraznawaz20-Feb-11 19:44 
GeneralRe: use of HitTest method Pin
Cool_Dev20-Feb-11 21:22
Cool_Dev20-Feb-11 21:22 
GeneralRe: use of HitTest method Pin
sarfaraznawaz21-Feb-11 0:24
sarfaraznawaz21-Feb-11 0:24 
GeneralRe: use of HitTest method Pin
Cool_Dev21-Feb-11 0:27
Cool_Dev21-Feb-11 0:27 
GeneralRe: use of HitTest method Pin
sarfaraznawaz21-Feb-11 0:53
sarfaraznawaz21-Feb-11 0:53 
GeneralRe: use of HitTest method Pin
Niklas L21-Feb-11 2:07
Niklas L21-Feb-11 2:07 
GeneralRe: use of HitTest method Pin
sarfaraznawaz21-Feb-11 19:13
sarfaraznawaz21-Feb-11 19:13 
QuestionHow to get value 1.3 from a float value 1.333333 Pin
Amrit Agr20-Feb-11 17:21
Amrit Agr20-Feb-11 17:21 
AnswerRe: How to get value 1.3 from a float value 1.333333 Pin
Luc Pattyn20-Feb-11 17:39
sitebuilderLuc Pattyn20-Feb-11 17:39 
AnswerRe: How to get value 1.3 from a float value 1.333333 Pin
Hans Dietrich20-Feb-11 17:51
mentorHans Dietrich20-Feb-11 17:51 
GeneralRe: How to get value 1.3 from a float value 1.333333 Pin
Amrit Agr20-Feb-11 18:44
Amrit Agr20-Feb-11 18:44 
AnswerRe: How to get value 1.3 from a float value 1.333333 Pin
Alain Rist20-Feb-11 20:21
Alain Rist20-Feb-11 20:21 
Hi,
The previous answers will not round correctly negative numbers and lack flexibility. Use the built-in facilities of the Standard C++ Library:
#include <sstream>
#include <iomanip>
double Round(double val, size_t decimal)
{
    std::ostringstream oss;
    oss << std::fixed << std::setprecision(decimal) << val << std::ends;
    std::istringstream(oss.str()) >> val;
    return val;
}
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.