Solved

easy question on MessageBox

Posted on 2004-09-26
9
259 Views
Last Modified: 2013-11-20
How can i use the MessageBox to print something like this?

MessageBox("You Pressed %c", pressedchar);
0
Comment
Question by:vikasgkutty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
9 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 25 total points
ID: 12155399
You can't do this, but have a look to this utility function:
http://www.codeguru.com/Cpp/misc/misc/article.php/c413/
0
 

Author Comment

by:vikasgkutty
ID: 12155469
But isnt there any other direct library functioon to do this
0
 

Author Comment

by:vikasgkutty
ID: 12155532
I think an easier way is like this

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

what do u say?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:mrwad99
ID: 12155536
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
 
LVL 19

Expert Comment

by:mrwad99
ID: 12155538
Hehe, looks like you agree with that then ;)
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12155619
MessageBox will work only inside a CWnd derived object.
use AfxMessageBox() instead.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question