Solved

MessageDlg Not Performing Correctly

Posted on 2003-12-10
2
346 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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