Solved

messagedlg question

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

messagedlg('Text',mtConfirmation,[mbYes,mbNo],0)

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?

0
Comment
Question by:max-hb
  • 2
4 Comments
 
LVL 4

Author Comment

by:max-hb
Comment Utility
In qcontrols.pas i found the following definition:
Const
  mrNone     = 0;
  mrOk       = mrNone + 1;
  mrCancel   = mrOk + 1;  
  mrYes      = mrCancel + 1;

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

Accepted Solution

by:
robert_marquardt earned 50 total points
Comment Utility
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.
0
 
LVL 1

Expert Comment

by:jellison
Comment Utility
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?

John
0
 
LVL 4

Author Comment

by:max-hb
Comment Utility
Yes, that's it!
Never do something like

uses controls,qdialogs;

It results in the problem I stated above.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 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

14 Experts available now in Live!

Get 1:1 Help Now