?
Solved

Indy IDHTTPServer and Windows shutdown

Posted on 2005-03-12
3
Medium Priority
?
328 Views
Last Modified: 2010-04-04
Hello!

I have an application using the Indy hTTP server and when I shutdown or logoff Windows while the application is still running, the application generate a bunch or error message before crashing...  
However, the application termianate fine if close manually...

I do De-Activate the server on Application close and Application Destroy... but still...

Is there a proper way to terminate the application/server when Windows is shuttong down?
0
Comment
Question by:PaulP
[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
3 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 500 total points
ID: 13524838
Hi,

Try to catch that message and de-activate your server there (in the main form only):

type
  TForm1 = class(TForm)
  private
    { Private declarations }
    procedure QueryEndSession( var Msg: TWMQUERYENDSESSION); message WM_QUERYENDSESSION;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.QueryEndSession( var Msg: TWMQUERYENDSESSION);
begin
  // add your code here
  // ...
  Msg.Result := 1; // can't remember exactly if it should return zero or non-zero (non-zero most probably)
end;

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 13524843
The result should be non-zero for sure.

Regards, Geo
0
 

Author Comment

by:PaulP
ID: 13527461
Thanks Geo!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 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