Click here to Skip to main content
13,449,326 members (46,262 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
Hello all,
I'm developing a windows mobile app and I often get a StackOverflowException. For what I can see, is that it comes because a lot a forms remain open, even when I dispose them every time I open a new one. I use a global class to get values from one form to another. Any idea why I get this exception? I don't have loops or things like this.

Thanks in advance.
Posted 23-Jul-12 4:26am
Updated 23-Jul-12 4:31am
Rajesh Varma Buddaraju 23-Jul-12 10:37am
Provide your code if possible so that way it will be easy to trace.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It generally isn't loops that cause Stack Overflow - it's unterminated recursion.

Check your code: is there anywhere where a method calls itself, directly or indirectly?
IviKAZAZI 23-Jul-12 10:37am
No,i dont think so. Could it be the form load event the cause? Because i have some piece of code there,where i do some checking,some if else etc. The function i recall in the code is the datagrid_fill to update it,after adding some rows in db.
OriginalGriff 23-Jul-12 10:52am
Without actually seeing it? Can't say! :laugh:
Sergey Alexandrovich Kryukov 23-Jul-12 16:49pm
Stack has nothing to do with open forms; it affects the volume of heap memory and unmanaged resources, not stack.
I may not thing so, but your problem is recursion.
Sergey Alexandrovich Kryukov 23-Jul-12 16:49pm
It's recursion; my 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02-2016 | 2.8.180318.3 | Last Updated 23 Jul 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100