Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing a form
Message
From
29/10/2003 07:16:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00843964
Message ID:
00843978
Views:
21
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform