?
Solved

C++ Code

Posted on 2011-02-15
4
Medium Priority
?
325 Views
Last Modified: 2012-08-14
if (MessageDlg(prompt, mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes)

What does the code in bold mean? This is Borland C++, though it shouldn't matter. I am trying to figure if TMsgDlgButtons() is accepting parameters?? or is the << operator used as left shit bit operator?? Or anything else. Pls assume very little C++ experience.
0
Comment
Question by:Mydeen Yussouf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
evilrix earned 500 total points
ID: 34897517
It looks like whatever TMsgDlgButtons() returns (whether it is a function or a constructor for that type) it has overloaded the << operator to allow the setting of values in one operation. In this case it looks like the object is being primed to accept a Yes and No user input (so, it probably displays those buttons).
0
 
LVL 1

Author Comment

by:Mydeen Yussouf
ID: 34897826
This is what the official help document says:

TMsgDlgButtons defines a set of values used by MessageDlg and MessageDlgPos.

Unit

Dialogs

enum TMsgDlgBtn { mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp };
0
 
LVL 1

Author Comment

by:Mydeen Yussouf
ID: 34916756
Can someone help me link the Help page with the actual usage in C++ terms?
0
 
LVL 40

Expert Comment

by:evilrix
ID: 34921228
State what is it you specifically don't understand and I'll try to make it clearer for you.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

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