Solved

easy MsgBox in Visual C++ 6.0 ??

Posted on 2002-05-10
5
2,359 Views
Last Modified: 2009-03-31
I know there is a function Msgbox in Visual Basic to pop up a simple msg box for error or warning. But what is the easy way to do that in C++ 6.0 with MFC? Do I have to create a dialog in resourse? Sorry, I'm new.
0
Comment
Question by:quanghoc
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 7002706
Just use "AfxMessageBox()" - e.g. like

AfxMessageBox ( "This is a Test");

or "MessageBox()" in general.

MessageBox ( NULL, "This is a test", "Test Caption", MB_ICONINFORMATION | MB_OK);
0
 
LVL 86

Expert Comment

by:jkr
ID: 7002708
BTW, regarding the question about the resource - no, you don't have to, Windows will take care of that in case of a message box.
0
 
LVL 1

Author Comment

by:quanghoc
ID: 7002741
Good, Thanks.
0
 
LVL 86

Expert Comment

by:jkr
ID: 7002743
You are welcome - feel free to post here if you encounter any problems.
0
 
LVL 1

Author Comment

by:quanghoc
ID: 7002751
Good, Thanks.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

770 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