Hi That is also what i am doing in the DLL DETACH method DLL_PROCESS_DETACH: > > begin // unloading dll better cleanup > > Logwrite(´Kalder DLL Detach´); > > DllForm.free; <<<< Here is TNCNX placed > > end;
i have tried DLL_PROCESS_DETACH: begin // unloading dll better cleanup FreeAndNil(DllForm.TnCnx1); DllForm.Free; end; But my calling application is still hanging. rgds, Peter Francois Piette <[EMAIL PROTECTED]> wrote: > A component dropped on a form should not be freed by hand. > The form will > automatically destroy it when the form itself is destroyed. > If you want to > free a component dropped on a form, use FreeAndNil. > > 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 > > ----- Original Message ----- > From: "Peter Calum" <[EMAIL PROTECTED]> > To: "Twsocket" <twsocket@elists.org> > Sent: Wednesday, August 09, 2006 1:59 PM > Subject: [twsocket] Hanging TNCNX component > > > > Hi all > > > > > > > > I have a problem regarding how to free TNCNX component > correctly. > > > > > > > > I have created a DLL which have a hidden form with a TNCNX > component on. > > > > Everything works fine, connect telnet commands, disconnect > and so, but > when > > > > the calling application terminates, the TNCNX is not > destroyed proberly, > and > > the > > > > application hangs. > > > > > > > > I create the form for the TNCNX component I DLL ATTACH > method and destroys > > > > It in the DETACH method. > > > > > > > > Does anyone have a hint for this problem.. > > > > > > > > Rgds, Peter > > > > Denmark > > > > > > > > > > > > { Procedure invoked by a DLL entry > } > > > > {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * * * * > * } > > > > > > > > procedure LibraryProc(Reason: Integer); > > > > begin > > > > case Reason of > > > > DLL_PROCESS_ATTACH: // dll loaded/initialize > > > > begin > > > > SetMainState(TN_Idle); > > > > DllForm := TDllForm.Create(Application); > > > > DllForm.Timer1.Enabled := false; > > > > PDel := '/'; > > > > end; > > > > DLL_PROCESS_DETACH: > > > > begin // unloading dll better cleanup > > > > Logwrite('Kalder DLL Detach'); > > > > DllForm.free; > > > > end; > > > > end; > > > > end; > > > > > > > > begin > > > > DllProc := @LibraryProc; > > > > { Now invoke the procedure to reflect that the DLL is > attaching > > > > to the process } > > > > LibraryProc(DLL_PROCESS_ATTACH); > > > > end. > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.1.405 / Virus Database: 268.10.8/414 - Release > Date: 09-08-2006 > > > > -- > > 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 > > -- > 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 -- 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