easy question on MessageBox

How can i use the MessageBox to print something like this?

MessageBox("You Pressed %c", pressedchar);
vikasgkuttyAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
You can't do this, but have a look to this utility function:
http://www.codeguru.com/Cpp/misc/misc/article.php/c413/
0
 
vikasgkuttyAuthor Commented:
But isnt there any other direct library functioon to do this
0
 
vikasgkuttyAuthor Commented:
I think an easier way is like this

CString s;
s.Format("You pressed %c",PressedChar);
MessageBox(s);

what do u say?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
mrwad99Commented:
Why don't you just do it the easy way, using a CString that is formatted with CString::Format (similar flags to printf), then pass this CString to the messagebox ?
0
 
mrwad99Commented:
Hehe, looks like you agree with that then ;)
0
 
Jaime OlivaresSoftware ArchitectCommented:
MessageBox will work only inside a CWnd derived object.
use AfxMessageBox() instead.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.