Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account

vb6 application crash on exit

  • Please log in to reply



    New Member

  • Member
  • Pip
  • 2 posts
I have a legacy vb6 app that crashes on exit - both as an executable and in the IDE. I am currently unloading the forms (except the frmmain) in form_unload, releasing all the adodb recordsets, setting all the boundcollections = nothing, I have attempted to SetErrorMode SEM_NOGPFAULTERRORBOX in the form_terminate event and that has not stopped the error from occurring. I have also checked for subclasses being instantiated in my code and found none. I have checked into the components from outside MS that are used - they are the Componentone flexgrid 8 spelling 8 and componentOne sizer control. An extensive web and forum search has not turned up any known problems similar to mine for these controls. The issue does not seem to occur if I shut down the program before actually doing anything. However loading the bound controls seems to be near where the problem is rooted, in spite of repeatedly stepping with the debugger it seems that the start of the problem "moves around". The problem occurs with the programmatic exit, the "X" and the IDE "end" control
The error message is
The instruction at "0x77d042b8" referenced memory at "0x055c9028". The memory could not be "Read". The title in the error box is a tool tip (differing at different times) from inside my app
sure appreciate any help I can get
  • 0




    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
It appears that the bug is dead, the kill was in 10 parts
1) very carefully disposing of all objects
2) confirming that each recordset was closed before it was set to nothing
3) closing each form from the last forms close event
4) set the last form .visible = false then called a timer for 1 second
5) added a getout call to the bottom of the last forms unload event
6) put the getout in a module
7) added
Private Declare Function SetErrorMode Lib "kernel32" ( _
   ByVal wMode As Long) As Long
to the declarations in that module
8) called that declaration with
at the start of the getout sub
9) confirmed that the last open form was closed
10) included this code at the bottom of the getout sub to make sure it could close
    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
        i = 0
that last part was sorta the equivalent of driving wooden stake into its heart
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP