Board index » delphi » Problem with Windows ressource and Modal Form???!!!??

Problem with Windows ressource and Modal Form???!!!??

Hi,
I got a problem with windows ressource.
When I create a modal form like this

NewInForm := TNewInForm.create(self);
NewInForm.showmodal;

I lost about 3% of ressource(normal) BUT (and that's not normal) when
I close my form like this

procedure TNewDesForm.FormClose(Sender: TObject; var Action:
TCloseAction);
begin
Proc_quit;
Action := caFree;
end;

But after this operation my percentage doesn't came back (AAARRRGGHH).
WHY?  Somebody could explain that???

Thanks in advance for help.

Gilles

E-mail : hbr...@crecherche.ulb.ac.be

 

Re:Problem with Windows ressource and Modal Form???!!!??


In Message-ID: <4mna4f$...@rc1.vub.ac.be>,  Gilles wrote:

Quote
> got a problem with windows ressource.
>When I create a modal form like this
>NewInForm := TNewInForm.create(self);
>NewInForm.showmodal;
>I lost about 3% of ressource(normal) BUT (and that's not normal) when
>I close my form like this
>procedure TNewDesForm.FormClose(Sender: TObject; var Action:
>TCloseAction);
>begin
>Proc_quit;
>Action := caFree;
>end;
>But after this operation my percentage doesn't came back (AAARRRGGHH).
>WHY?  Somebody could explain that???

Change the lines that create the form to something like this:

begin
    try
        NewInForm := TNewInForm.create(self);
        NewInForm.showmodal;
    finally
        NewForm.Free;
    end;
end;

This should fix your problem!

HTH

Ken White
qpwpla...@aol.com

Other Threads