Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection Object
Message
De
07/10/1999 11:17:02
 
 
À
07/10/1999 10:47:46
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00273466
Message ID:
00273730
Vues:
21
>Scott-
>
>Keep in mind that when you release the form, you may need to clean up any outstanding object references in order for the form to release.
>
>What I found (at least in 5.0) was that I had to loop through my array of objects and set each to .NULL. It wasn't enough to set the array property to .NULL., IOW.
>
>BTW, what you originally asked for was a collections object, and while there are ways to do it in VFP (and very nice ways, too), I'd also like it if there was a base collections object. Even more than that that every object's collection property was the same. For example, why does the collection property for pageframes ("pages") have to be named differently from the the one for forms ("controls"). JMHO.

Nancy,

Let me ask a question if you don't mind.

If one creates an ojbect in the "top level" program which contains a 'collection'(whether array based, individual properties or as you would like, a real collection, etc) and then passes that object to a form, are there any known issues with respect to having to clean up in the DESTROY method of that form?

What I'm hoping to do is two fold:

1. Create just such an object containing an array of object references and pass that to every form I instantiate. THose object references would point to either COM objects or application-specific objects.

2. Create a form class that has in its INIT method a constant naming convention for that passed in object. IOW, EVERY form would always have a passed in object reference and local-to-the-form properties that gave the form class a constant, basic way of managing that passed in object.

Here's the idea.... If Form A calls Sub-Form B, I'd ADDOBJECT() to this passed in object if Sub-Form B needed extra info and then I'd hope that when Sub-Form B was DESTROYed then the cleanup would all be automatic.

oControlObject = createobject("Yakkity Yak","YakkityYak.vcx")
add object oSecurityModule
...

*
** call the form
*
oForm = createobject("SubFormB","MyForms.vcx")
SomeControlVariable =oForm(oControlObject).show() <-- not sure this is correct

*
** the called form
** INIT method
*
parameters oPassedInObjectReference

if vartype("oPassedInObjectReference") <> "O"
*
** do something here
*
endif

*
** Then, do something like this to check this user's rights
*
oPassedInObjectReference.oSecurityModule.CheckUserRights(thisform,oPassedInObjectReference.oUser.UserID)

Is there anything I'm missing with this approach. Things like, "Great idea Doug but you're guaranteed to get a C00000005 error", or "Works great DD but your apps speed will be cut to 1/10 of what it should be." *G*

Thanks!

Best,
Best,


DD

A man is no fool who gives up that which he cannot keep for that which he cannot lose.
Everything I don't understand must be easy!
The difficulty of any task is measured by the capacity of the agent performing the work.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform