Solved

'System.StackOverflowException'

Posted on 2004-04-27
9
478 Views
Last Modified: 2012-05-04
I am in the process of upgrading a VB6 Application I did not write...

I am running into a problem on pretty much every form I call from the Main Form.

If I call a form by clicking a command once it is fine, however, if I call the form then close it and call it again I get an error.

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

it breaks  in the windows form designer code at the line

 <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  BREAKS HERE =>      Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMunQuarter))

Any help greatly appreciated.

Thanks!!
0
Comment
Question by:bberdel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 6

Expert Comment

by:gtvingo14
ID: 10930105
are you using SQL?
0
 

Author Comment

by:bberdel
ID: 10931193
It is a Database Application but it is running off an access database.

There are some SQL Queries...
0
 
LVL 10

Expert Comment

by:EBatista
ID: 10932159
by the error you are getting i think you have a cyclically executed method/function.
provide us with the code of that command you are clicking
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10933460
it is code that is recursing beyond allowed stack ...
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10933463
oops sorry EB you said that
0
 

Author Comment

by:bberdel
ID: 10938324
This is the code after teh upgrade to open the form  

Private Sub Command18_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command18.Click
        'Open_Report Command18.Caption
        VB6.ShowForm(frmMunQuarter.DefInstance, 0, frmMain.DefInstance)
    End Sub
0
 
LVL 10

Accepted Solution

by:
EBatista earned 175 total points
ID: 10942385
replace the code in the button event handler for this one:

Private Sub Command18_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command18.Click
        Dim ofrmMunQuarter as new frmMunQuarter()
        ofrmMunQuarter.Owner=Me
        ofrmMunQuarter.ShowDialog() 'or ofrmMunQuarter.Show()
End Sub

the event for the button that close the frmMunQuarter instances must look like:

Private Sub Command18_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command18.Click
   me.Dispose()
End Sub
 
the upgrading feature is a nice tool, but i never have felt 100% happy with it due to the odd code it place.

regards
0
 

Author Comment

by:bberdel
ID: 10942616
Thanks, I actually figured it out earlier today (using the same solution)

I got it from a microsoft article, but I will award you the points.

Thanks again!
0
 
LVL 10

Expert Comment

by:EBatista
ID: 10942880
thanks bberdel :)
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question