VB 6 crash on exit

I have an outdated vb6 application that crashes on exit - both in the executable and in the IDE. How can I avoid an accident?

  • I am currently uploading forms (except frmmain) to form_unload, freeing all ADODB RecordSets, setting all boundcollections = nothing.
  • I tried SetErrorMode SEM_NOGPFAULTERRORBOXin the event form_terminateand did not stop the error.
  • I also checked that subclasses were created in my code and not find them.
  • I checked the components from outside of Microsoft that are used - this is the control element 8 of the spelling elements of ComponentOne flexgrid 8 and ComponentOne. A broad search on the Internet and the forum did not reveal any known issues like mine for these controls.

The problem does not occur if I close the program before doing something. However, loading related controls seems to be where the problem is rooted, despite switching to the debugger many times, it seems that the beginning of the problem is "moving". The problem occurs with program output, control "X" and the "final" IDE error message The instruction at "0x77d042b8" referenced memory at "0x055c9028". The memory could not be "Read". The heading in the error field is a tooltip (different at different times) inside my application. I take breaks when going through the code - the application crashes in the output line under the Form_Unload event

ADDED
 I realized that I had to include some other information in my original post. I was very tired and disappointed when I did this, and regret that it was so hard to read.
Now the images 1) I have the latest service pack installed (6), and the latest component assemblies
2) Performing debugging in my VS2010 ide (which is on the same server), I got a very long stack dump, starting with OLEAUT32.dll, I updated this DLL, but did not find any changes 3) I actually run (and work) the program through a remote connection to the desktop. The program crashes on my desktop, as well as on user terminal connections.
4) The OS I'm running on is Windows Server 2003
5) The code I'm running is 'Code'

    Private Sub Form_Unload(Cancel As Integer)
        Set rsChild = Nothing
        Set rsCaseFile = Nothing
        ' many similar record sets closing
        ys.CloseConnection
        Set ys = Nothing
        UnloadAllForms (Me.Name)
        ' closeing bound collections 
        Set bndChild = Nothing
         Set bndAuth = Nothing
         ' more bound collections closed
         ' i had added the next two lines but it made no difference
         frmmain.close
         Set frmMain = nothing 
         getout
    end sub
    Public Sub UnloadAllForms(Optional FormToIgnore As String = "")
        Dim f As Form
        For Each f In Forms
            If Not f Is Nothing Then
                If f.Name <> FormToIgnore Then
                    Unload f
                    Set f = Nothing
                End If
            End If
        Next f   
    End Sub

'\code'  

6) "getout" , , ,
.

+3
3

, , 10
1)
2) , , | 3)
4) .visible = false, 1
5) getout

6) getout
7)

'code'
Private Declare Function SetErrorMode Lib "kernel32" ( _
   ByVal wMode As Long) As Long  
Private Const SEM_FAILCRITICALERRORS = &H1  
Private Const SEM_NOGPFAULTERRORBOX = &H2  
Private Const SEM_NOOPENFILEERRORBOX = &H8000&  
'code'  


8)

'code'
SetErrorMode SEM_NOGPFAULTERRORBOX  
'code' 

get
9) ,
10) getout, ,

'code'  
    Dim tstart As Date  
    tstart = TimeValue(Now())  
    Dim i As Integer  
    i = 0  
    Do While (DateAdd("s", 3, tstart)) > TimeValue(Now())  
        For i = 0 To 1000  
            i = i + 1  
        Next  
        i = 0  
    Loop   
   ' endtask("PLacements") 

    End  
'code'  


, , MarkJ - ,

+3

, . , - , (). , , . , , . VB .

0

.

  • Windows, VB SP6 ?
  • ? - .
  • Try to track this by removing fragments of the program until it stops crashing. Then put the pieces back until they collapse. This will help you keep track of which components or code are involved. It doesn't matter if the program works, you just need to know if it will work on exit. You can comment or delete entire classes, delete controls, whatever.
0
source

All Articles