Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > how to display a number in a messagebox?

Reply
Thread Tools

how to display a number in a messagebox?

 
 
sdeyoreo@hotmail.com
Guest
Posts: n/a
 
      01-15-2005
How do I display the integer in pt.x in a message box?
I get a error on parameter 2 of MessageBox call:

char str[255];
sprintf(str,"point x is %d",pt.x);
MessageBox(NULL,str,NULL,MB_OK);

 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      01-15-2005
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I display the integer in pt.x in a message box?
> I get a error on parameter 2 of MessageBox call:
>
> char str[255];
> sprintf(str,"point x is %d",pt.x);
> MessageBox(NULL,str,NULL,MB_OK);


What is the error message?

-Mike


 
Reply With Quote
 
 
 
 
Pete
Guest
Posts: n/a
 
      01-15-2005
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I display the integer in pt.x in a message box?
> I get a error on parameter 2 of MessageBox call:
>
> char str[255];
> sprintf(str,"point x is %d",pt.x);
> MessageBox(NULL,str,NULL,MB_OK);
>


Probably:

TCHAR str[255];
_stprintf(str, _T("point x is %d"), pt.x);
MessageBox(0, str, 0, MB_OK);

If you're compiling with Unicode support MessageBox is a macro to the
Unicode MessageBoxW.

Make sure to include the correct headers (you can find them on MSDN), and
please direct further Windows questions to
comp.os.ms-windows.programmer.win32.

- Pete


 
Reply With Quote
 
sdeyoreo@hotmail.com
Guest
Posts: n/a
 
      01-16-2005
On Sat, 15 Jan 2005 22:31:58 GMT, "Pete" <(E-Mail Removed)> wrote:

>TCHAR str[255];
>_stprintf(str, _T("point x is %d"), pt.x);
>MessageBox(0, str, 0, MB_OK);


Works great, thanks alot!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
OT: Number Nine, Number Nine, Number Nine FrisbeeŽ MCSE 37 09-26-2005 04:06 PM
choosing to display or not to display a checkbox in repeater control. Imran Aziz ASP .Net 4 08-11-2005 05:00 PM
Double double display display problem problem Tom Accuosti Firefox 3 09-27-2004 10:02 PM
Display and display model Marc Twain Java 1 01-13-2004 07:05 PM



Advertisments