I am getting crazy. A program that used to run ok as supposed, suddenly started giving this error in debug mode. I know I made some small changes, but even fixing it, still gives this error.
When not in debug mode, the program closes itself without being supposed to, and also without any other error message. Is this something obvious?
Two controls with the same ID will do it.
I've remembered sometime ago something that did the same. The solution was increasing stack size and stack commit size. Did it now and worked...
I also remember of discuss this here already. It is not too much worrying have big stack sizes, right? Anyway, there is a way to round it? In 15 days I might forget this, and in 30 days another program breaks due to this... :/
The compiler will warn you if it detects a subroutine exceeding stack size at compile time. But it can't predict overall stack usage for things like reentrant subroutines, recursion, etc. Your total stack usage is the size of the local variables in the current execution path.
So if Foo() calls Foo2() which calls Foo3() then stack usage when Foo3 is running is the total of the local variables defined in all three subroutines.
The easiest way around it is to change your coding habits. Don't define mammoth arrays in subroutines. use NEW and DELETE instead and pass a pointer around if you need to.
Paul.
I guess that slowly I can do it. I learn and use, lets say, at least 1 great trick per month in these foruns :) thank you