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
Solved

'System.StackOverflowException'

Posted on 2004-04-27
9
476 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

792 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