Solved

MessageDlg Not Performing Correctly

Posted on 2003-12-10
2
350 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
[X]
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 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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