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" , , ,
.