Re: [twsocket] Handles in components
- Original Message - From: "Francois PIETTE" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Friday, January 26, 2007 9:04 PM Subject: Re: [twsocket] Handles in components > > Should be no handle left. But pay attention that if you destroy any > control > with a window handle from a thread which has not created the control, then > the window handle is /not/destroyed (DestroyWindow fails but usually his > return value is not checked). > Everything is created in the threads execute, so that should be fine. > Have a look at Bear utility > (http://www.geocities.com/the_real_sz/misc/bear_.htm) it can display the > number of window handles an application use. Very handy to see if they are > freed when you think. I'll test it, but it needs to run as a service because the desktop switching occurs after a user logoff, after which regular applications are destroyed.. Thanks Paul -- 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] Handles in components
> I'm having troubles with switching between desktops using the (Ssl)HttpCli > in a thread with message pump. > You can't switch between desktops when handles are used. > So I'm trying to switch between desktops by freeing the client, switch to > new desktop and recreate the client, but this thread fails to switch to > another desktop. > All other threads used are swithing without problems. > Are there any handles left after freeing the client? Should be no handle left. But pay attention that if you destroy any control with a window handle from a thread which has not created the control, then the window handle is /not/destroyed (DestroyWindow fails but usually his return value is not checked). Have a look at Bear utility (http://www.geocities.com/the_real_sz/misc/bear_.htm) it can display the number of window handles an application use. Very handy to see if they are freed when you think. -- 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
[twsocket] Handles in components
I'm having troubles with switching between desktops using the (Ssl)HttpCli in a thread with message pump. You can't switch between desktops when handles are used. So I'm trying to switch between desktops by freeing the client, switch to new desktop and recreate the client, but this thread fails to switch to another desktop. All other threads used are swithing without problems. Are there any handles left after freeing the client? Paul -- 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
Re: [twsocket] Freeze when using smtp after recreating itsparentform
Can't help myself... just have to comment this... (sorry) > You can read in earlier mails why I do not want the dll to be loaded at all > time. 1) You didn't want a dll linked to _your application_ even when you can be pretty sure that the DLL itself is already loaded in memory at all times whether you use it or not 2) You can be sure that outher components load the same DLL at startup time and are linked to your application during the entire execution. Note that this is the standard behaviour of all DLL-handling. If your programs are not sprinkled with LoadLibrary() calls, you now have a lot of work in front of you so you can save memory in your applications... So... Who do we blame for all the trouble? Yes.. The one whoever came with the overambiscious idea to support dynamic loading of the Winsox-DLL(?) ... :-D -- 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] Freeze when using smtp after recreating itsparentform
Henrik wrote: > Hi Arno! > > As I've said before Arno, You're a funny guy, though I'm sure > unintentionally. Doesn't seem so long ago You kept going on with > viruses and > trojans and didn't even seem to read the note I made about that we > were able > to duplicate ICS's problems with the environment on a _brand new_ > computer... :-) Viruses, Anti-Virus tools as well as trojans basically use the same API hooking (intercepting) technics as this Embassy Trust Suite (Detours DLL). They may hook for instance LoadLibrary() not correctly thus causing errors when ICS loads winsock DLLs dynamically. If you think that's just a joke I cannot help you, but please stop claiming that ICS was buggy. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- 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] Freeze when using smtp after recreating itsparentform
Hi Arno! As I've said before Arno, You're a funny guy, though I'm sure unintentionally. Doesn't seem so long ago You kept going on with viruses and trojans and didn't even seem to read the note I made about that we were able to duplicate ICS's problems with the environment on a _brand new_ computer... :-) Never the less I'm glad You've come to Your senses but I had to draw the line somewhere. Perhaps I can look in to this in the future but as it is now I've invested far too many days trying to find the solution to the problem. // Henrik Ps. By the way Arno, it's not that constructive to blame "everyone else" before sitting down and actually think the problem through. I've mentioned this to You before. I think You could learn a great deal from Wilfried Mestdagh there. In my experience he is very constructive in his way of encircle the problem. In this example: As You know there are many solutions out there in the same fields as ICS that do not have any problems with certain environments that evidently causes problem for ICS. Even though sincere I don't think it promotes ICS that You suggest that ICS-using developers every time there comes up a new environment causing problem for ICS, and after they on the customer side have had to trace down what new application or what ever that that causes problems for ICS this time, is forced to turn to the computer manufacturer or external application developer and ask them to remake their part before ICS is going to work... Especially when other "competitors" has products that works in the same environment. Well this was just a personal opinion. Thanks once again for the help. Since I regrettable no longer use ICS I'm unsubscribing to this email list for the time being. -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Arno Garrels Skickat: den 25 januari 2007 18:09 Till: ICS support mailing Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform Strange logic Henrik, Even Microsoft's Works doesn't/didn't work with this buggy, API hooking Embassy Trust Suite pre-installed on newer DELL systems. Possibly they already fixed it in some service pack? If not, someone/we should report the bug to either DELL or Wave Systems. I was hoping that you helped identifying the Embassy Trust Suite clearly as the culprid. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html Henrik wrote: > Hi Arno and others! > > Some of the heavy work load I experienced a while ago has decreased a > bit so I thought that I should take the opportunity to thank You ALL > that tried to help me. > > At the end the solution for me was to use another smtp component. > Sorry about that. (As a request by Francois Piette I'm not going to > mention it by name in this news group.) > Even if it is like You say Arno, that the problem is not originating > from ICS it is still toghether with the SmtpCli component the problem > appears. This makes it impossible to use the SmtpCli component > knowing that users might not be able to use our application under > certain _normal_ circumstances (like in our test case with a new Dell > laptop). We can not tell our users that they have to uninstall other > softwares just to be able to send emails from our application. > Even if it is not a bug in ICS code or design the fact remains: Other > smtp components out there works just fine under the same > circumstances. So that was why I was forced to take that path. > > But once again: Thank You all for the help! You are doing a wonderful > job! Best Regards > Henrik -- 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] Freeze when using smtp after recreating itsparentform
Hello Dan! Yes, Wilfried Mestdagh helped me with that. He actually read my mail and understood why my own strange workaround worked. (Thank You Wilfried!) Both Wilfried and I are professional developers though, and we do not feel very comfortable using workarounds in opposite to find the actual error. After days of investigation, (and tries to make everyone understand that it was ICS way of coexist with other good applications that was the problem), I had to look at it with financial eyes and had to let go and choose another solution. Thank You for all the help! Best Regards Henrik Ps. You can read in earlier mails why I do not want the dll to be loaded at all time. Since I regrettable no longer use ICS I'm unsubscribing to this email list for the time being. -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Dan Skickat: den 25 januari 2007 22:44 Till: 'ICS support mailing' Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform I thought it was figured out that dynamically unloading and reloading the dll was the problem, which other components probably don't do, and I think you were given a workaround that worked...to load it manually so that the loaded count always stays above 0 and it remains loaded. Dan > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Henrik > Sent: 25 January 2007 16:42 > To: 'ICS support mailing' > Subject: Re: [twsocket] Freeze when using smtp after recreating > itsparentform > > Hi Arno and others! > > Some of the heavy work load I experienced a while ago has decreased a bit > so > I thought that I should take the opportunity to thank You ALL that tried > to > help me. > > At the end the solution for me was to use another smtp component. Sorry > about that. (As a request by Francois Piette I'm not going to mention it > by > name in this news group.) > Even if it is like You say Arno, that the problem is not originating from > ICS it is still toghether with the SmtpCli component the problem appears. > This makes it impossible to use the SmtpCli component knowing that users > might not be able to use our application under certain _normal_ > circumstances (like in our test case with a new Dell laptop). We can not > tell our users that they have to uninstall other softwares just to be able > to send emails from our application. > Even if it is not a bug in ICS code or design the fact remains: Other smtp > components out there works just fine under the same circumstances. So that > was why I was forced to take that path. > > But once again: Thank You all for the help! You are doing a wonderful job! > Best Regards > Henrik > -- 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, 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