Solved

C++ Code

Posted on 2011-02-15
4
304 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:olmuser
  • 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:olmuser
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:olmuser
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

758 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

21 Experts available now in Live!

Get 1:1 Help Now