When my (MDI) App starts I open a random access file (RAF) that is designed to help nail down a problem in the event of a crash:
Open App.Path & "\AppFlowDebug.dat" For Output As #100
As my App runs I write out key data:
Print #100, "FOO"
Unfortunately, since I currently have in my
Close #100
statement in my MDIForm_Unload routine, when the App does crash the RAF is not properly closed and some of the data written to it is lost.
Does there exist a VB routine that ALWAYS gets called just before an App crashes? If so, I could simply insert the Close statement there.
Or do I need to write such a routine and explicitly call it via On Error/GoTo code added to each subroutine in my App?
Open App.Path & "\AppFlowDebug.dat" For Output As #100
As my App runs I write out key data:
Print #100, "FOO"
Unfortunately, since I currently have in my
Close #100
statement in my MDIForm_Unload routine, when the App does crash the RAF is not properly closed and some of the data written to it is lost.
Does there exist a VB routine that ALWAYS gets called just before an App crashes? If so, I could simply insert the Close statement there.
Or do I need to write such a routine and explicitly call it via On Error/GoTo code added to each subroutine in my App?