>Hi! I have a form which when I call thisform.release() does not get released, it just sits there in the background.
>
>What could cause the form to do this?
>
>TIA
Robin,
Check these :
-Form is modal and there is a call to it using with..endwith ? (I think sort of dangling object reference). ie:
Local loForm
loForm = Createobject("myform")
With loForm
.Show(1)
Endwith
Wait Window 'Released'
Release loForm
Define Class myForm As Form
Add Object cmdRelease As CommandButton ;
with Caption = "Release"
Procedure cmdRelease.Click
Thisform.Release
Endproc
Enddefine
There are 2 fixes to the above.
1) Do not use with..endwith :
loForm.Show(1)
2) Do not call release but hide (I prefer this one as I can directly access to that form's PEM after code continues to run at next line - wait window...)
Procedure cmdRelease.Click
Thisform.Hide
Endproc
-A dangling object reference. Hard to sample and behavior is not the same across all versions. ie: For FoxyClasses DatetimeCtrls set 1, I worked hard to make it version 5 compatible w/o leaving a dangling ref. (hope it's not the cause in this case:)
-A misplaced or with no clear events, Read events (might cause exception C0...5 too)
-Lockscreen. Not likely but worth to think of IMHO.
Cetin