• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

'System.StackOverflowException'

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
bberdel
Asked:
bberdel
  • 3
  • 3
  • 2
  • +1
1 Solution
 
gtvingo14Commented:
are you using SQL?
0
 
bberdelAuthor Commented:
It is a Database Application but it is running off an access database.

There are some SQL Queries...
0
 
EBatistaCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
gregoryyoungCommented:
it is code that is recursing beyond allowed stack ...
0
 
gregoryyoungCommented:
oops sorry EB you said that
0
 
bberdelAuthor Commented:
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
 
EBatistaCommented:
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
 
bberdelAuthor Commented:
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
 
EBatistaCommented:
thanks bberdel :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now