Re: [twsocket] Exception handling in a Form

2007-01-26 Thread Wilfried Mestdagh
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

2007-01-26 Thread Arno Garrels
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


Re: [twsocket] Exception handling in a Form

2007-01-25 Thread Wilfried Mestdagh
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

2007-01-25 Thread Arno Garrels
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

2007-01-25 Thread Arno Garrels
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

2007-01-25 Thread Wilfried Mestdagh
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

2007-01-25 Thread Veit Zimmermann
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