Board index » delphi » D1 : a few questions about window creation errors in MDI forms

D1 : a few questions about window creation errors in MDI forms

i get the message : 'window creation error' at runtime
(french translation of 'erreur de creation de fenetre')
it's a project with about 50 forms

Q ===> is it too much? (even it they are not loaded?)

but i made only my main form available at startup.

From this main form, i'm calling a MDI form with 5 tabbed notbooks
and a lot of components in it

Q ===> is there a limit?

my first MDI form is called with:

  myFirstForm:=tmyFirstForm.create(application);
  myFirstForm.show;

execution is ok (all components are visible and fully fonctionnal!)
until i call my second MDI form (same number of notebooks, a lot of
components too)
all components are enabled in my second form, but i come back to
my first form and click on a certain (not always the same!),
i got the message ('windows creation error')

well it seems to be a stack problem (or is it a local heap problem
or even something else?)

Q ===> runtime created components are stored in which structure?
       stack, heap, delphi stuff, windows stuff ????????

my project options for the linker are :
stack      : 29000
local heap : 8192

but if i try to raise the stack size, D1 tells me that
data segment is too large !!!
(menu/compilation/information tells me :
 code size : 1389645 bytes
 data size : 27372 bytes
 .
 (stack and heap as shown before)
 .

whats the trick ???

is there a way to resolve this?

Q ===> could u help me or i'm running mad!!!

btw : forgive my poor english,
      forgive me if i ask this last Q : what the heck SPAM or spawn
stands for?
      is there some trouble with this (some guys add something in their
email
      address, why?

thank u by advance

 

Re:D1 : a few questions about window creation errors in MDI forms


  This error (Error Creating Window) is normally the result of your app
running out of windows handles.  Each windowed control on a form will use
up a windows handle once
it is displayed.  Unfortunately when you then hide the form or change to a
different page of a TabbedNotebook the handle is not freed up
automatically.  For example if you have a form with a tabbed notebook which
has 5 pages with 100 edit boxes on each page then as you look through each
page additional handles are used up for each control on that page.  By the
time you get to the fifth page you will probably have maxed out the number
of handles available to the app (this is a fixed
number but I'm not sure what the limit is).  One solution to minimize the
problem is to use non-windowed controls where possible.  I.e. use a TLabel
and a TBevel instead of a TPanel.

Another thing you can do is to take a look at the code provided in TI3138
at Borland's web site ( http://www.borland.com/devsupport/delphi/ti_list/
).  This shows how to handle the problem with Tabbed Notebooks and can
probably be adjusted to work for other situations.

Hope this helps!
--

Rodney E Geraghty
GERA-Tech
Ottawa, Canada
gera...@ibm.net

easy <e...@neuronnexion.fr> wrote in article
<33D363EC.2...@neuronnexion.fr>...

Quote
> i get the message : 'window creation error' at runtime
> (french translation of 'erreur de creation de fenetre')
> it's a project with about 50 forms

> Q ===> is it too much? (even it they are not loaded?)

> but i made only my main form available at startup.

> From this main form, i'm calling a MDI form with 5 tabbed notbooks
> and a lot of components in it

> Q ===> is there a limit?

> my first MDI form is called with:

>   myFirstForm:=tmyFirstForm.create(application);
>   myFirstForm.show;

> execution is ok (all components are visible and fully fonctionnal!)
> until i call my second MDI form (same number of notebooks, a lot of
> components too)
> all components are enabled in my second form, but i come back to
> my first form and click on a certain (not always the same!),
> i got the message ('windows creation error')

> well it seems to be a stack problem (or is it a local heap problem
> or even something else?)

> Q ===> runtime created components are stored in which structure?
>        stack, heap, delphi stuff, windows stuff ????????

> my project options for the linker are :
> stack      : 29000
> local heap : 8192

> but if i try to raise the stack size, D1 tells me that
> data segment is too large !!!
> (menu/compilation/information tells me :
>  code size : 1389645 bytes
>  data size : 27372 bytes
>  .
>  (stack and heap as shown before)
>  .

> whats the trick ???

> is there a way to resolve this?

> Q ===> could u help me or i'm running mad!!!

> btw : forgive my poor english,
>       forgive me if i ask this last Q : what the heck SPAM or spawn
> stands for?
>       is there some trouble with this (some guys add something in their
> email
>       address, why?

> thank u by advance

Other Threads