Solved

easy question on MessageBox

Posted on 2004-09-26
9
209 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

20 Experts available now in Live!

Get 1:1 Help Now