Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form won't release because of object reference?
Message
 
À
30/04/1997 16:19:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00030164
Message ID:
00030410
Vues:
54
>>>>Thanks, this is a bit neater until we figure out the proper way to do this. Anyone? Has anyone had problems releasing forms when you have "this.objref = thisform.txtMyTextBox" in controls?
>>>
>>>Forgive me for backpedaling a little here, but why are you setting up your addressing in this way to begin with?
>>
>>Because the form will not form will not release if any of its child objects has an external reference. So instead of using a true VFP object reference the child object is referenced be name and then dereferenced via a with/endwith statement. Hope this Clarifies
>>
>>Peter
>
>I guess what I'm trying to figure out why the need to set up the external reference to begin with. I can imagine some examples - for instance, when you want to do a given set of operations to any one of several objects, you could assign an object reference of the selected object to a variable or property and then use that reference - that's the point of polymorphism.
>
>But if you do that to an object on a form, it only makes sense that the form will not release, since there is a live reference to an object on the form external to the form, and the object is not released until all references are released, thus it's container (the form) is not released.
>
>If you are trying to get the benefits of polymorphism, you might want to destroy the spare object reference after you are done working with it. If you simply want to do a dereferencing with WITH/ENDWITH, you can do that with the true address, too. If none of those, then I'm not sure why you are setting up the external reference in the first place. That was my backpedaling question - what is the actual effect of what you are trying to do?

I referenced objects by their name because I wanted to keep an array of objects and be able to sort them by their Top property (using asort)
I was not aware that the bug that causes true references to fail had been fixed in 5.0a, but Michel said it had previously in this thread.

Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform