Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: MessageDlg parameters


This question is answered.


Permlink Replies: 2 - Last Post: Oct 23, 2014 12:21 PM Last Post By: Kenneth Czepelka
Kenneth Czepelka

Posts: 22
Registered: 1/3/06
MessageDlg parameters  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 10:55 AM
1) I'm trying to use MessageDlg in my FM application like such:

MessageDlg("my message", mtConfirmation, mbYesNoCancel,0);

I get an error that mtConfirmation is invalid although in the help file under TMsgDlgType (for FM) this shows as a valid enum in C++

If I replace it with (TMsgDlgType)0 as a parameter, then it's OK.

2) Also I really need just mbYesNo for my buttons but there isn't a enum for this. So how do I put just a mbYes and mbNo to show in this function?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: MessageDlg parameters
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 11:26 AM   in response to: Kenneth Czepelka in response to: Kenneth Czepelka
Hello Kenneth,

1) I'm trying to use MessageDlg in my FM application like such:

MessageDlg("my message", mtConfirmation, mbYesNoCancel,0);

I get an error that mtConfirmation is invalid although in the help
file under TMsgDlgType (for FM) this shows as a valid enum in C++

Two words: Scoped enums. You have to qualify the enum name:

MessageDlg("my message", TMsgDlgType::mtConfirmation, mbYesNoCancel, 0);


2) Also I really need just mbYesNo for my buttons but there isn't a
enum for this. So how do I put just a mbYes and mbNo to show in
this function?

The third parameter is a Set of multiple buttons. mbYesNoCancel is a constant
that specifies the Yes, No, and Cancel buttons. If that does not suit your
needs, simple specify the actual buttons you want:

MessageDlg("my message", TMsgDlgType::mtConfirmation, TMsgDlgButtons() << 
TMsgDlgBtn::mbYes << TMsgDlgBtn::mbNo, 0);


--
Remy Lebeau (TeamB)
Kenneth Czepelka

Posts: 22
Registered: 1/3/06
Re: MessageDlg parameters  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 23, 2014 12:21 PM   in response to: Kenneth Czepelka in response to: Kenneth Czepelka
That did the trick, thank you so much!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02