Quantcast
Viewing latest article 9
Browse Latest Browse All 27395

[RESOLVED] Best way to locate "System.StackOverflowException" the cause for recursive issue?

I'm generating a program that works/interfaces with a company portal, and all of a sudden upon compiling I get a "System.StackOverflowException". Now I did recently add a new class and this started, but I'm sure that is only a coincidence as I have removed the class and I still obtain the error.

I have also commented out the one location which there is a known recursive action, but that still has not resolved the StackOverFlow error. The error is resulting in the main form, so I'm not sure how the error is occuring when the main form is only run once. Though there are a couple of places that it does get instantiated due to a function call, shown below, but after the function call it is released. I just can't locate the thing and I'm looking for suggestions on how to discover the beast causing the issue?

Main Form error location:

Code:

Public Class EPIQ

    Dim m_oBrowser As New ClsBrowser
    Dim m_oWinCtrls As New ClsWinCtrls
    Dim m_oExcel As New ClsExcel

Image may be NSFW.
Clik here to view.
Name:  Screenshot 2025-05-31 185434.png
Views: 55
Size:  10.0 KB


I have this code commented out that is the officially known recursive location.

Code:

Private Sub ExecuteRun(ByVal nRunOption As Integer, ByVal szMenuSelection As String, ByVal szEventNumber As String, ByVal szPINumber As String, ByVal szPERNumber As String, ByVal nCurrentPhase As Integer)

    Dim szTBelementName As String

    Try

        If (GetIsDebug()) Then
            Debug.Print("FRM_EPIQ [ExecuteRun Enter]" & vbCrLf)
        End If

        'clear our flag
        SetAbortRun(False)
        SetProgramRunning(True)
        SetDiscard(False)

        'UpdateRunControls(ENUM_RUN.eRUN_DISABLE_CTRLS, cMSG_RUNNING, "ExecuteRun")
        Select Case GetRunOption()
            Case ENUM_RUN.eRUN_NONRETURN
                RunNonReturn(GetRunOption())

            Case ENUM_RUN.eRUN_REVIEW
                szMenuSelection = cID_MENU_MAIN_ALL_BY_NUMBER
                szTBelementName = GetMenuSearchElement(nRunOption)
                If (RunReview(nRunOption, szMenuSelection, szTBelementName, szPINumber)) Then
                    GetBrowser.DoEvents()

                    End If

                Case ENUM_RUN.eRUN_ANALYSIS
                    RunAnalysis(nRunOption, szPINumber)

                    'Enable the Run Type combobox
                    UpdateRunControls(ENUM_RUN.eRUN_BTN_RUN_COMPLETE, cMSG_OPERATION_COMPLETE, "ExecuteRun")
                Case ENUM_RUN.eRUN_MISSED_RISK_REVIEW
                    RunMissedRiskReview(nRunOption, szPINumber, szPERNumber)

                    'Disable the Run Type combobox
                    UpdateRunControls(ENUM_RUN.eRUN_MAIN_PER_PIM_COMPLETE, cMSG_OPERATION_COMPLETE, "ExecuteRun")
                Case ENUM_RUN.eRUN_NONCOMPLAINT_PIM
                    szMenuSelection = cID_MENU_MAIN_ALL_BY_NUMBER
                    szTBelementName = GetMenuSearchElement(nRunOption)

                    RunNonComplaintPIM(nRunOption, szMenuSelection, szTBelementName, szEventNumber, nCurrentPhase, szPINumber, szPERNumber)

                    'Disable the Run Type combobox
                    '            FRM_OPTIONS.show
                    UpdateRunControls(ENUM_RUN.eRUN_MAIN_COMPLETE_NONCOMPLAINT_PIM, cMSG_OPERATION_COMPLETE, "ExecuteRun")
                Case ENUM_RUN.eRUN_CLOSE_PER
                    'Disable the Run Type combobox
                    '            FRM_OPTIONS.show
                    UpdateRunControls(ENUM_RUN.eRUN_LOADED_PER_FILES, cMSG_OPERATION_COMPLETE, "ExecuteRun")
            End Select

            If (GetIsDebug()) Then
                Debug.Print("FRM_EPIQ [ExecuteRun Exit]" & vbCrLf)
            End If

            If (CBool(GetOptionMember(ENUM_OPTIONS.eROW_OPTIONS_GENERAL_AUTO_RUN, cCOL_START)) = True And (GetRunOption() = ENUM_RUN.eRUN_CLOSE_PER = True Or GetRunOption() = ENUM_RUN.eRUN_NONCOMPLAINT_PIM = True)) Then
                '        LoopCount = LoopCount + 1
                '        'Log out and log back in
                '        If (LoopCount = 50) Then
                '            Call LogOut
                '            Call Login
                '        End If

                szMenuSelection = GetMenuSearchElementFromMenuEnum(GetRunOption())
                'ExecuteRun(GetRunOption(), szMenuSelection, CB_EVENT_NUMBER.Text, GetPINumber(), GetPERNumber(), GetCurrentPhase())
            End If


            'SetProgramRunning(False)
        Catch ex As Exception
            Dim szErr As String
            szErr = "Error occured for the following reason [" & ex.Message & "]"
            If (GetIsDebug()) Then
                Debug.Print(szErr)
            End If
        End Try


    End Sub

This function is originated from a KeyDown function, but then if a flag is set to Auto_Run the it performed recursively.

Code:

    Private Sub CB_EVENT_NUMBER_KeyDown(sender As Object, e As KeyEventArgs) Handles CB_EVENT_NUMBER.KeyDown

        Dim szMenuSelection As String

        If (e.KeyCode = Keys.Enter) Then
            SetAbortRun(False)
            szMenuSelection = GetMenuSearchElementFromMenuEnum(GetRunOption())

            CreatePIString(CB_EVENT_NUMBER.Text)
            CreatePERString(CB_EVENT_NUMBER.Text)

            ExecuteRun(GetRunOption(), szMenuSelection, CB_EVENT_NUMBER.Text, GetPINumber(), GetPERNumber(), GetCurrentPhase())

        End If

    End Sub

Any suggestions on where to start locating this issue? I'm going through now and commenting out as much as I can in the Browser class, but so far nothing has changed.

EDIT: I do get the following error, is this related to the recursive error?

"Severity Code Description Project File Line Suppression State Details
Warning (active) BC40003 sub 'UpdateRunControls' shadows an overloadable member declared in the base class 'EPIQ'. If you want to overload the base method, this method must be declared 'Overloads'. EPIQ Interface C:\Users\epperbx\source\repos\EPIQ Interface VB New\EPIQ Interface\ClsWinCtrls.vb 67
"
Attached Images
Image may be NSFW.
Clik here to view.
 

Viewing latest article 9
Browse Latest Browse All 27395

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>