Solved

C++ Code

Posted on 2011-02-15
4
314 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
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
evilrix earned 125 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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++.

740 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