> I have also tried adding this to the Application OnClose Event:
> procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
> var
>  i : Integer;
> begin
>   i := WSocketServer1.ClientCount;
>   for i := 0 to i - 1 do begin
>    WSocketServer1.Client[i].Close;
>   end;
> end;

It's probably just a typo, however the above cannot work.
I also suggest to iterate the other way around:
"for i := WSocketServer1.ClientCount -1 downto 0 do"
since it may happen that the client list shrinks while
looping.
Is your application multi threaded? Have you dropped
the server component onto the form? What component are
we talking about?

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html




----- Original Message ----- 
From: "wayne forrest" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Tuesday, February 19, 2008 1:42 PM
Subject: Re: [twsocket] Invalid Window Handle when Application Closed 
andActiveConnections


> It is a Bit Hard to Find the Exact Location of the Error;
>
> The Debugger goes into : Sysutils to Raise the LastOSError;
>
> System Error: 1400, invalid window handle.
>
> If I hit Ctrl+F3; to get the STACK TRace, there is nothing that is
> worthwhile to track.
>
>
> I have also tried adding this to the Application OnClose Event:
> procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
> var
>  i : Integer;
> begin
>   i := WSocketServer1.ClientCount;
>   for i := 0 to i - 1 do begin
>    WSocketServer1.Client[i].Close;
>   end;
> end;
>
> the above made no Difference.
>
> Any other Ideas;
>
>
>
> On Feb 19, 2008 2:32 PM, Francois Piette <[EMAIL PROTECTED]> 
> wrote:
>
>> > I get an Error when I close my Server Application:  "Invalid Window
>> Handel"
>> > I get the ERROR when there are USers Connected.
>>
>> Run your application under the debugger to see where it happend exactly.
>>
>>
>> > I want to put something in Application on close Event.
>>
>> I suggest you disconnect all clients before closing the application.
>>
>> Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
>> --
>> [EMAIL PROTECTED]
>> Author of ICS (Internet Component Suite, freeware)
>> Author of MidWare (Multi-tier framework, freeware)
>> http://www.overbyte.be
>>
>>
>> --
>> To unsubscribe or change your settings for TWSocket mailing list
>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
>> Visit our website at http://www.overbyte.be
>>
>
>
>
> -- 
> C: 076 337 4368
> T: 021 880 2037
> F: 021 880 2530
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to