You didn't set the Tfrm_client global variable to nil after freeing. That is a 
dangling pointer and is a no no. I have added the line below as it should 
appear:

begin
 with Tfrm_Client.Create(Self) do begin
 try
 Show;
 Act_New.Execute;
 Hide; 
 ShowModal;
finally
 Free;
Tfrm_Client := nil;         <--  line of code to be added

 end;
 end;
 end;
 


Dino Lolli <[EMAIL PROTECTED]> wrote:                             Thank you so 
much.  That did the trick.  I really appreciate the help from everyone.  One 
more thing.  Does anyone know of a good memory leak detector.  I believe my 
program is leaking memory somewhere as some clients have complained that it 
slows down after hours of use but I have checked and rechecked my code and all 
resources are properly freed.  Thanks once again Joao and everyone that replied
 
 Regards
 
 Dino Lolli
 
 Sales and Support
 
 skypeGreen Skype: dino_lolli
 
 From: delphi-en@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joao 
Carlos
 Sent: 31 May 2008 04:20 PM
 To: delphi-en@yahoogroups.com
 Subject: RE: [delphi-en] Code after showmodal statement
 
 Hello,
 
 Try this code:
 
 begin
 with Tfrm_Client.Create(Self) do begin
 try
 Show;
 Act_New.Execute;
 Hide; 
 ShowModal;
 finally
 Free;
 end;
 end;
 end;
 
 Cumprimentos,
 
 JC
 
 -----Original Message-----
 From: delphi-en@yahoogroups.com <mailto:delphi-en%40yahoogroups.com>  
[mailto:delphi-en@yahoogroups.com <mailto:delphi-en%40yahoogroups.com> ] On 
Behalf Of Dino Lolli
 Sent: sábado, 31 de Maio de 2008 11:38
 To: delphi-en@yahoogroups.com <mailto:delphi-en%40yahoogroups.com> 
 Subject: RE: [delphi-en] Code after showmodal statement
 
 Hi
 
 Thanks for the reply but that code gives a "Cannot focus on invisible
 Window" error. Any other ideas
 
 Regards
 Dino Lolli
 Sales and Support
 Soft Edge Solutions
 We do computer maintenance, networking, hardware and software sales and
 website development
 We are the proud developers of Plumber's Assistant
 [EMAIL PROTECTED] <mailto:dinol%40softedgesolutions.co.za> 
 www.softedgesolutions.co.za
 Cell: 082 572 1059
 Fax: 0866 84 73 73
 Skype: dino_lolli
 
 Click here to join the monthly newsletter
 
 -----Original Message-----
 From: delphi-en@yahoogroups.com <mailto:delphi-en%40yahoogroups.com>  
[mailto:delphi-en@yahoogroups.com <mailto:delphi-en%40yahoogroups.com> ] On 
Behalf
 Of Theodoros Bebekis
 Sent: 31 May 2008 12:17 PM
 To: delphi-en@yahoogroups.com <mailto:delphi-en%40yahoogroups.com> 
 Subject: Re: [delphi-en] Code after showmodal statement
 
 O/H Dino Lolli έγραψε:
 
 > var
 > 
 > frm_Client : Tfrm_Client;
 > 
 > begin
 > 
 > frm_Client := Tfrm_Client.Create(Self);
 > 
 > try
 > 
 
 > frm_Client.Act_New.Execute;
 > frm_Client.ShowModal;
 > 
 
 > 
 > finally
 > 
 > frm_Client.Release;
 > 
 > end;
 > 
 > end;
 
 -- 
 Regards
 Theo
 
 ------------------------
 Theo Bebekis
 Thessaloniki, Greece
 ------------------------
 Greek_Delphi_Prog : a Delphi Programming mailing list in Greek at
 http://groups.yahoo.com/group/Greek_Delphi_Prog
 
 CSharpDotNetGreek : A C# and .Net mailing list in Greek language at
 http://groups.yahoo.com/group/CSharpDotNetGreek
 
 atla_custom : a Unisoft Atlantis Customization mailing list at
 http://groups.yahoo.com/group/atla_custom
 ------------------------
 
 ------------------------------------
 
 -----------------------------------------------------
 Home page: http://groups.yahoo.com/group/delphi-en/
 To unsubscribe: [EMAIL PROTECTED] 
<mailto:delphi-en-unsubscribe%40yahoogroups.comYahoo> ! Groups Links
 
 ------------------------------------
 
 -----------------------------------------------------
 Home page: http://groups.yahoo.com/group/delphi-en/
 To unsubscribe: [EMAIL PROTECTED] 
<mailto:delphi-en-unsubscribe%40yahoogroups.comYahoo> ! Groups Links
 
 [Non-text portions of this message have been removed]
 
 
     
                                       

       

[Non-text portions of this message have been removed]

Reply via email to