Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form contains common controls refuse to destroy
Message
De
13/07/1998 13:33:10
Juan Kh
Dataprop Technologies
Sungai Petani, Malaisie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00116620
Message ID:
00116848
Vues:
16
Dave,

CLEAR ALL works in the command window, it remove the form peacefully. But it does not work in destroy event of the form. The message given is "object still in use", something like that.

I'd narrow down the search by adding a few lines of code in the destroy method of the form. These are the codes to remove all objects manually, using THISFORM.REMOVEOBJECT("myObject"), until the last object in the form. I notice the code failed when it tried to remove the TreeView object. I have no idea what holds up the object, preventing it from destroying. I check the code carefully and cannot find any pending reference to this object. Is there any other way to get rid of these "unknown" reference to objects???

Thanks again,
juan

>Juan,
>
>If you are positive that you don't have any held object references. The LOCAL ones that you mentioned in your reply to Jim shouldn't cause a problem. Every object carries an internal reference counter that is incremented each time a reference to that object is stored. It is decremented each time the reference is cleared. An object will not release until it's reference counter goes to 0. A form won't close until all of it's contained objects are released. That's why you see the behavior of the Close button disabling. A CLEAR ALL should get rid of the form while you search for what's preventing it's normal release.
>
>Are you using PEMSTATUS() or GETPEM() in your code? These can sometimes leave internal references to the objects that prevent VFP from releasing the object. You can usually use TYPE() to work around this bug.
>
>>I have a form with a treeview and listview controls. I'd coded the NodeClick method of TreeView to fill up the tree by adding 3 child nodes to all of the existing nodes (which had been added by form's init method). All work fine up to this stage. However, when I tried to call the node click method from the listview (by supplying the neccesary parameter, which is a "node" object), after the method execute, the treeview was filled up as if it were run by clicking on the node, fine. However, when I click on the close button of the form, the form fail to go away, and the close button was disbled then. This leave me no mean of exiting the form. I used the debugger to trace some of the event while shutting down the form, it seems that the event fires up to form.destroy, and it stops, no further than that.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform