
Mabry's MouseWheel.OCX crashes using END statement
Hi Bob:
Quote:
>Mabry Software's MouseWheel OCX crashes whenever it encounters the END
>statement in a compiled program. Mabry doesn't admit this to being a bug.
>Instead, they say I shouldn't use the end statement.
Mabry is correct! You should not use End to terminate your application.
Using End cause VB to terminate your application immediately, which does not
allow for objects to properly "clean up" after themselves.
To properly terminate your application you must set all object references to
nothing and close all open forms, i.e.
'Main application form
Private Sub Form_Unload(Cancel As Integer)
Dim frm As frm
'Set all objects to nothing
Set mclsWhatever = Nothing
...etc
'Close all open form
For Each frm In Forms
Unload frm
Next frm
End Sub
Note: If one of the open forms has a Timer, make sure you disable the timer
before unloading the form.
Doug.