Solved

easy question on MessageBox

Posted on 2004-09-26
9
218 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now