messagedlg question

Posted on 2002-05-14
Medium Priority
Last Modified: 2011-09-20
Hi there!
Something's wrong with the result of the messagedlg() function?


gives me an integer result of 3 when pressing "Yes" in the dialog at runtime.
This should correspond to the constat "mrYes", but this has an integer value of 6 so

if (messagedlg('text',mtconfirmation,[mbyes,mbno,0)=mryes)
 then // Yes clicked

does not work properly.

Any ideas?

Question by:max-hb
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

Author Comment

ID: 7008361
In qcontrols.pas i found the following definition:
  mrNone     = 0;
  mrOk       = mrNone + 1;
  mrCancel   = mrOk + 1;  
  mrYes      = mrCancel + 1;

... but still inttostr(mrYes)="6" ... strange
LVL 11

Accepted Solution

robert_marquardt earned 200 total points
ID: 7008469
mrYes in qcontrols.pas has obviously the value 3. The mrYes constant of controls.pas has the value 6.
So you most probably have qcontrols and controls in your uses. That is wrong.

Expert Comment

ID: 7008474
In my source files:  (Delphi 3)

In Controls.pas

mrYes = idYes;

and in Windows.pas

IDYES = 6;

Which might explain why you get a 6.  Which version are you using?


Author Comment

ID: 7008560
Yes, that's it!
Never do something like

uses controls,qdialogs;

It results in the problem I stated above.

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month11 days, 6 hours left to enroll

752 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