Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create member in code before other members instantiate
Message
De
06/09/2009 17:06:49
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
04/09/2009 12:53:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01421954
Message ID:
01422885
Vues:
195
>It works this way: You define a property oBiz in your container and set it's value to "<-expression", the method above will evaluate the expression. So a simple expression could be "<-Createobject('bizclass')".

Yes, that's what I'm doing. Just calling the factory instead.

>The idea you already used with a factory has the problem of the datasession, but that could also be solved by passing in THISFORM or THIS to the factory as an toParent parameter and the factory could use toParent.Addobject() to instanciate some class and voila, it's part of the form's session, not of the session the factory is in.

This and Thisform don't exist yet. It simply doesn't evaluate the expression when I try to pass them as parameters. So instead of that, I have a general function CallFactory() which instantiates the factory on the fly, creates the object (and since it's in a .prg, executes in current DS, so the factory and anything it creates are in that same DS), kills the factory and returns the object. Since the factory is, almost by definition, very lightweight, this costs almost nothing in terms of performance.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform