Greetings People
have question here.Is there any way that I can out put a value (which is stored in a variable )
using MessageBox() .
thanks.
Greetings People
have question here.Is there any way that I can out put a value (which is stored in a variable )
using MessageBox() .
thanks.
I would think you would need to wsprintf() to a temporary string first then pass that to MessageBox().
Of course, that only applies to primitive variable types (int, long, double, etc.). If you've got a fancy-pants C++ class member that you want to work with then you'll probably need to convert it first.
It depends on which language you want to do it in. As I normally use C:-
Code:char szTemp[16]; // this must accomodate AT LEAST the maximum string length of what you want to display PLUS an extra character for null termination int iValue = 123456789; // the value that you want to display wsprintf(szTemp, "%i", iValue); MessageBox(NULL, szTemp, NULL, MB_ICONINFORMATION);
If you have to do this conversion more than once, you might want to use Prelude's stringstream example from the FAQ Section.