PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Too many controls and/or windows in the application (9999).
Too many controls and/or windows in the application (9999).
Iniciado por Alex, 15,abr. 2024 20:49 - 3 respuestas
Publicado el 15,abril 2024 - 20:49
Hi everyone,

I got to the bottom of the problem I was asking about some time ago. I was asking if anyone experienced:

"<xxxxxxxxxxxxx> was not created by Windows" error

In WD 2024 this message was additionally extended by:

"The Sheet1 control (Tab type) has not been created for the following reason:"
"Too many controls and/or windows in the application (9999)."

We have rather complex forms for different documents. It seems that after opening 6-7 of those forms and leaving them open user exceeds some kind of Windev limit. In Windev help it is stated that the limitation per window is:

"Maximum number of controls per window Greater than 5,000.
This limit can be less depending on the operating system used."

and no other limit for the application level has been defined.

Any ideas? Any help is appreciated.

Thanks again,
Alex
Miembro registrado
80 mensajes
Publicado el 21,abril 2024 - 13:07
look how many controls are on a sheet, and then calculate how many controls will be open in the window if you have a few of these sheets open at the same time. You could then limit the number of open sheets to a value less than 5000 controls.
If different sheets have different no of controls ( internal windows), You could also hold a global count of controls and then do the same - require sheets to close before more are opened.) This will also help with memory management.

You will be surprised at how easily you can reach 5000 controls per window.

--
Ben Dell
Riebens Computers Pty Ltd
Southern Africa PcSoft Distributor
www.windevsa.co.za
PcSoft Sales, Support and Training
Mensaje modificado, 21,abril 2024 - 13:09
Publicado el 25,abril 2024 - 21:50
Thanks Ben,

I will try to optimize it. I do not think it is a single window limit, it seems that it is cumulative number of controls on all open windows that causes the problem.

Regards,
Alex
Publicado el 01,mayo 2024 - 18:36
Hi everyone,

I have an update on this issue which may be interesting to the community. After some investigating I found out that Windows itself imposes a limit to the number of GDI objects for a single process - application. This limit is by default 10000 and can be changed in registry to the maximum value of 18000. I was observing the number of GDI objects for our application within Task Manager -> Details tab and I concluded that it behaves consistently, when you open window the number goes up and when you close it it goes back to the initial value. Changing tabs within the same window affects this number in such way that it increases like if some of the objects are created dynamically, however it doesn't go back when changing back the tab selection. I also came to the conclusion that each and every column of each data grid is treated as a single GDI object even if hidden. So opening of a typical document form in our case increases the number of used GDI objects by ~1500 (it seems that we were too ambitious when we were designing screens). So, opening of 7 such windows and leaving them open leads to inevitable limit breach and exception which causes application crash in MDI parent/child paradigm.

So far I was not able to find any way to dynamically control application so that only those controls which are on visible tabs are instantiated and basically delay the control creation until it gets visible. I observed some other ERP apps, written with Delphi for example, where windows with similar complexity use up far less GDI objects.

If anyone has any suggestion I would like to hear it very much.

Hope this info can be of use to someone.

Regards,
Alex