Board index » delphi » EOutOfResources Window handles

EOutOfResources Window handles

I have been forced to write a system using 16bit Delphi 1 for a client who will
not move from Windows 3.1.

I seem to have reached a limit on the number of controls I can use in the
project and get this error.

Can any one suggest how I can overcome the problem.

Peter Yellow
UK

 

Re:EOutOfResources Window handles


Are you auto-create all the forms of your application? If so, remove most of
them from the auto-create list (project-options). Just create them where
there a needed, and free them afterwards.

--
Andreas Klein
eMail: a-k...@metronet.de

Stangate schrieb in Nachricht
<1998052523304700.TAA09...@ladder01.news.aol.com>...

Quote
>I have been forced to write a system using 16bit Delphi 1 for a client who
will
>not move from Windows 3.1.

>I seem to have reached a limit on the number of controls I can use in the
>project and get this error.

>Can any one suggest how I can overcome the problem.

>Peter Yellow
>UK

Re:EOutOfResources Window handles


Stangate <stang...@aol.com> wrote in article
<1998052523304700.TAA09...@ladder01.news.aol.com>...

Quote
> I have been forced to write a system using 16bit Delphi 1 for a client
who will
> not move from Windows 3.1.
> I seem to have reached a limit on the number of controls I can use in the
> project and get this error.
> Can any one suggest how I can overcome the problem.

When you add forms to a project, they are automatically added to the
project file, where they are created on startup.
This is a common reason for resources being used up.
Create the forms on the fly, as they are required. Something like:

Form1 := TForm1.Create(self);
Form1.ShowModal;
Form1.Free;

This has the added advantage of speeding up execution time of your app.
Don't forget to remove the 'offending' code from the .dpr file.

Does that answer your question?

- Graeme Vincent

Other Threads