Re: [twsocket] Exception handling in a Form
Hello Veit, Connect as whell as other methods can raise exceptions in case of failure. This because there has to be something prepare to connect in this case. Then the real connection happens in background and you dont have to worry for exceptions. If there are they are internally handled. If connect fails then OnSessionConnected will fire with a winsock error. Good idea is to put some code in OnBgException of TWSocket. It can fire if you have an unhandled exception in your code. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, January 26, 2007, 08:32, Veit Zimmermann wrote: Hello Wilfried Thanks for your reply. The answer is a surprise for me: Of course I know try except/finally, but why does it work when I wrap it around TnCnx.Connect? I thought this is an asynchronous method? But it works. I would have expected that the try/except block is left right after calling connect and not only until the connection is established or an exception occurs. Could you please explain this? Veit Wilfried Mestdagh wrote: Hello Veit, Normally the components handles their own exception by design (as it should be). Be sure you have no exceptions in events. If there is a chance that your code can raise an exception then you should have that event into an try excpet block and handle it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, January 25, 2007, 17:04, Veit Zimmermann wrote: Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- * * Dipl.-Ing. Veit Zimmermann [EMAIL PROTECTED] * * VECTRONIC Aerospace GmbH www.vectronic-aerospace.com * * Carl-Scheele-Str. 12 tel: +49 (0)30 6789 4990 * * D-12489 Berlin fax: +49 (0)30 6789 5230 * * Germany WGS84: 52°25.83'N 13°31.52'E * * -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Exception handling in a Form
Ahh, thanks :) BTW: Do you know the greatest hooking library available? If not, take a look add MadCodeHook it's for Delphi, BCB as well as C. GREAT COMPONENT from the autor of Madexcept. Arno Wilfried Mestdagh wrote: Hello Veit, Connect as whell as other methods can raise exceptions in case of failure. This because there has to be something prepare to connect in this case. Then the real connection happens in background and you dont have to worry for exceptions. If there are they are internally handled. If connect fails then OnSessionConnected will fire with a winsock error. Good idea is to put some code in OnBgException of TWSocket. It can fire if you have an unhandled exception in your code. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, January 26, 2007, 08:32, Veit Zimmermann wrote: Hello Wilfried Thanks for your reply. The answer is a surprise for me: Of course I know try except/finally, but why does it work when I wrap it around TnCnx.Connect? I thought this is an asynchronous method? But it works. I would have expected that the try/except block is left right after calling connect and not only until the connection is established or an exception occurs. Could you please explain this? Veit Wilfried Mestdagh wrote: Hello Veit, Normally the components handles their own exception by design (as it should be). Be sure you have no exceptions in events. If there is a chance that your code can raise an exception then you should have that event into an try excpet block and handle it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, January 25, 2007, 17:04, Veit Zimmermann wrote: Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- * * Dipl.-Ing. Veit Zimmermann [EMAIL PROTECTED] * * VECTRONIC Aerospace GmbH www.vectronic-aerospace.com * * Carl-Scheele-Str. 12 tel: +49 (0)30 6789 4990 * * D-12489 Berlin fax: +49 (0)30 6789 5230 * * Germany WGS84: 52°25.83'N 13°31.52'E * * -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Exception handling in a Form
Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Exception handling in a Form
Hello Veit, Normally the components handles their own exception by design (as it should be). Be sure you have no exceptions in events. If there is a chance that your code can raise an exception then you should have that event into an try excpet block and handle it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, January 25, 2007, 17:04, Veit Zimmermann wrote: Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Exception handling in a Form
You probably hit the wrong button. Your mail is addressed to me privately. Arno Wilfried Mestdagh wrote: Hello Veit, Normally the components handles their own exception by design (as it should be). Be sure you have no exceptions in events. If there is a chance that your code can raise an exception then you should have that event into an try excpet block and handle it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, January 25, 2007, 17:04, Veit Zimmermann wrote: Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Exception handling in a Form
Arno Garrels wrote: You probably hit the wrong button. Your mail is addressed to me privately. Perfect chaos, sorry. Please ignore this mail. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Arno Wilfried Mestdagh wrote: Hello Veit, Normally the components handles their own exception by design (as it should be). Be sure you have no exceptions in events. If there is a chance that your code can raise an exception then you should have that event into an try excpet block and handle it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, January 25, 2007, 17:04, Veit Zimmermann wrote: Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Exception handling in a Form
Hello Arno, Perfect chaos, sorry. Please ignore this mail. That's because we are programmers :) However there is one thing. Hitting 'reply to all' does address the mail also to the original poster. I dont like it as it start often private mailings. And 'reply to all' is a common used button in buziness. Francois is this something you can disable ? --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Exception handling in a Form
Hello Wilfried Thanks for your reply. The answer is a surprise for me: Of course I know try except/finally, but why does it work when I wrap it around TnCnx.Connect? I thought this is an asynchronous method? But it works. I would have expected that the try/except block is left right after calling connect and not only until the connection is established or an exception occurs. Could you please explain this? Veit Wilfried Mestdagh wrote: Hello Veit, Normally the components handles their own exception by design (as it should be). Be sure you have no exceptions in events. If there is a chance that your code can raise an exception then you should have that event into an try excpet block and handle it. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, January 25, 2007, 17:04, Veit Zimmermann wrote: Hi May be I'm missing something, but... How can I catch an exception raised by an asynchronous function like TnCnx.Connect in a form. In a TApplication there is a Method for this (HandleException). Is there something similar for a TForm? TIA Veit -- * * Dipl.-Ing. Veit Zimmermann [EMAIL PROTECTED] * * VECTRONIC Aerospace GmbH www.vectronic-aerospace.com * * Carl-Scheele-Str. 12 tel: +49 (0)30 6789 4990 * * D-12489 Berlin fax: +49 (0)30 6789 5230 * * Germany WGS84: 52°25.83'N 13°31.52'E * * -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] exception handling
hi how can i globaly hanlde ftpserver execptions ? i understand how to make it on a client side but i am confused how to do it on a server. thank for helping roland -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] exception handling
Roland Frei wrote: hi how can i globaly hanlde ftpserver execptions ? Generaly use a global exception handler for all unhandled exceptions only. You should handle exceptions locally where they are being raised. This not only applies to ICS but also generally to all Delphi applications. Arno Garrels i understand how to make it on a client side but i am confused how to do it on a server. thank for helping roland -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] exception handling
how can i globaly hanlde ftpserver execptions ? i understand how to make it on a client side but i am confused how to do it on a server. Not sure I understand what exceptions you mean. Anyway, have you tryed with Application.OnException ? -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] exception handling OK
if found how to do it by google: http://www.chami.com/tips/delphi/011497D.html thx all On Mon, 15 Aug 2005 13:57:25 +0200, Arno Garrels [EMAIL PROTECTED] wrote: Roland Frei wrote: hi how can i globaly hanlde ftpserver execptions ? Generaly use a global exception handler for all unhandled exceptions only. You should handle exceptions locally where they are being raised. This not only applies to ICS but also generally to all Delphi applications. Arno Garrels i understand how to make it on a client side but i am confused how to do it on a server. thank for helping roland -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be