Board index » delphi » Com Server Shut Down

Com Server Shut Down

Does anyone know how to suppress the "Com server is still active da ta da ta
da" when windows closes after a client app has aborted?

If a client app aborts it can be restarted and hook back into the server
which is still running, obviously the object count of the server is too high
at shutdown and the Com server message appears.

--
Thanks in Advance

Mathew Verdouw
Mat...@vtc.com.au

 

Re:Com Server Shut Down


Hello,

If you have a main form for your server, try this:

uses
  ComServ;

type
  TComServerHack = class (TComServer);

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  while (TComServerHack (ComServer)).ObjectCount > 0 do
    TComServerHack (ComServer).CountObject (FALSE);
  CanClose := TRUE;
end;

have fun,
--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
Mathew Verdouw wrote in message <752npp$l...@forums.borland.com>...
>Does anyone know how to suppress the "Com server is still active da ta da
ta
>da" when windows closes after a client app has aborted?

>If a client app aborts it can be restarted and hook back into the server
>which is still running, obviously the object count of the server is too
high
>at shutdown and the Com server message appears.

>--
>Thanks in Advance

>Mathew Verdouw
>Mat...@vtc.com.au

Other Threads