Solved

'System.StackOverflowException'

Posted on 2004-04-27
9
477 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

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…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 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