Results 1 to 13 of 13

Thread: StackOverflow Exception

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    12

    StackOverflow Exception

    Hello! During the execution the program stumble in a StackOverflow Exception.
    What is and how can I solve?

  2. #2
    Hyperactive Member The_Duck's Avatar
    Join Date
    May 2005
    Location
    Leamington, UK
    Posts
    351

    Re: StackOverflow Exception

    Try putting some debugger messages into your code to see where things are going wrong

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    12

    Re: StackOverflow Exception

    Actually the exception revealed in some code generated by Windows form project, at the execution of this instruction:

    # Region
    Public Sub New()
    MyBase.New() <-- !!

  4. #4
    Hyperactive Member The_Duck's Avatar
    Join Date
    May 2005
    Location
    Leamington, UK
    Posts
    351

    Re: StackOverflow Exception

    Umm I doubt this.

    A StackOverflow Exception means that you have created an infinate loop somewhere.

  5. #5
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: StackOverflow Exception

    Faulty or unterminated recursive algorithms are generally the main culprit for this error.
    I don't live here any more.

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: StackOverflow Exception

    Quote Originally Posted by Akix
    Actually the exception revealed in some code generated by Windows form project, at the execution of this instruction:

    # Region
    Public Sub New()
    MyBase.New() <-- !!
    Are you inheriting from a custom class?
    I don't live here any more.

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    12

    Re: StackOverflow Exception

    Only System.Windows.Forms.Form in both the forms

  8. #8
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: StackOverflow Exception

    And you haven't edited the stock Form constructor or anything?
    I don't live here any more.

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    12

    Re: StackOverflow Exception

    Nope.

  10. #10
    Hyperactive Member The_Duck's Avatar
    Join Date
    May 2005
    Location
    Leamington, UK
    Posts
    351

    Re: StackOverflow Exception

    Can you show us the whole of your New subroutine?

  11. #11

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    12

    Re: StackOverflow Exception

    Imports System.Net
    Imports System.Security.Cryptography.X509Certificates
    Imports System.StackOverflowException

    Module Variabili
    Public percorso_loc As String = ""



    Public Class Form1
    Inherits System.Windows.Forms.Form

    Public F1 As New Form1
    Public Sub Main()
    Application.Run(F1)
    End Sub
    #Region
    Public Sub New()
    MyBase.New() <-- the exception is here!
    [...]
    #end region
    Public Class MyPolicy[...]
    Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click[...]
    Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Handles Button2.Click

    Dim f2 As New Form2
    Application.Run(f2)
    end sub

    End Class
    End Module

  12. #12
    Hyperactive Member The_Duck's Avatar
    Join Date
    May 2005
    Location
    Leamington, UK
    Posts
    351

    Re: StackOverflow Exception

    Can we see the bit after
    #Region
    Public Sub New()
    MyBase.New() <-- the exception is here!
    [...]

    I am not convinced that the exception is in MyBase.New

  13. #13
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: StackOverflow Exception

    Hi,

    Use a Tyr.... Catch block and get a full error message
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width