• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

easy question on MessageBox

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

MessageBox("You Pressed %c", pressedchar);
0
vikasgkutty
Asked:
vikasgkutty
  • 2
  • 2
  • 2
1 Solution
 
Jaime OlivaresSoftware 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now