|
-
Jan 3rd, 2003, 01:47 PM
#1
Thread Starter
Junior Member
What is the Diference?
What is the diference in this commands?
AfxMessageBox("Test"); -----and
MessageBox("Test");
-
Jan 3rd, 2003, 02:08 PM
#2
Frenzied Member
The afx call is meant for use under MFC. It supports a help context as well.
MessageBox will work for platform SDK development, as well as MFC. No help context.
-
Jan 3rd, 2003, 03:59 PM
#3
AfxMessageBox does a few things for you.
First it selects a title for the message box (the application name or if that doesn't exist the exe file name). Then it chooses a default icon based on the buttons you specify if you haven't selected an icon.
Then AfxMessageBox does the setup for the context help. It uses an MFC-internal mechanism for that.
Finally AfxMessageBox calls the WinAPI MessageBox.
Actually most of this is done by CWinApp::DoMessageBox, but this is hidden from the user.
AfxMessageBox has an overload which takes an UINT instead of a string. This overload loads the string resource identified by the UINT parameter and then calls the string version passing the newly loaded string. Very useful for localization.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 5th, 2003, 05:41 AM
#4
Hyperactive Member
MessageBox is a plain windows API function, included in user32.dll. You would use it in standard Win32 projects that do not require MFC.
AfxMessageBox comes with MFC. I think by using it you add an extra "layer" of processing to your program.
hope that helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|