Solved

MessageDlg Not Performing Correctly

Posted on 2003-12-10
2
347 Views
Last Modified: 2012-05-04
I have an application with numerous forms.  On some forms when I use the messagedlg function, message box does not appear but the system is still waiting for a response so the application is frozen because I can not give it a response.  Does anyone know why this may be happening and why on some forms in the application but not others?
0
Comment
Question by:mcmahling
2 Comments
 
LVL 5

Accepted Solution

by:
delphized earned 250 total points
ID: 9916822
messagedlg actually create a runtime delphi tform and populate with components, and then make a showmodal.
there is no particular reason to froze the application. (but do you use some secondary threads?)
Normally I use windows.messagebox that is a call to a window API function and is more stable.
you can try with it:

  MessageBox(self.handle,
             'Hello',
             PChar(Application.title),
             MB_OK or
             MB_ICONINFORMATION or
             MB_APPLMODAL);

you can also use application.messagebox, in which there is a call to windows.messagebox, but it's surrounded with delphi code. It's you choice.

in both cases I think it's better that messagedlg.
0
 

Expert Comment

by:songhd
ID: 9917871
I think some wrong with your application,some fatal wrong  code after the showmessage.Today I happened to meet it.I use AdoQuery to find the record,before this I use showmessage,but the messagebox did not exist ,the system is still waiting for a response so the application is frozen.
Now code is :
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('hi');
while not AdoQuery2.Eof do
begin
if Edit1.Text=AdoQuery2.FieldByName('name').AsString then Have:=True;
//Now, I find out that I lost the AdoQuery2.Next code.
end;
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

792 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