Solved

easy question on MessageBox

Posted on 2004-09-26
9
243 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
  • 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
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!

 
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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 72
how do i create updater to My Activex application? 3 101
sum13 challenge 24 134
Way to decrease size of apk file 9 104
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

763 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