Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Order of instantiation
Message
De
09/03/2009 14:26:39
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
09/03/2009 11:14:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
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:
01386633
Message ID:
01386713
Vues:
139
This message has been marked as the solution to the initial question of the thread.
>I am not sure if I understand the problem correctly; but if you want a specific object within a container (ANY container - Container, Form, Page...) to get instantiated first, you can select it and send it to back. The ZOrder and the instantiation order are related.

It already is the first by zOrder. But the memberclass-defined objects get instantiated out of zorder, before everything else, just between form.load() and dataenvironment.init().

And when I created a memberclass-defined object of my own and added it to the class, it was again the first in zorder, and still the columns and pages instantiated before it.

And here's the solution: a little prg should create the bizobject to my container, and the way to call that early enough is... weird: I added a label, and its .caption property is =makebizobj(this.parent, [bizclassname]). The code returns "done", but meanwhile creates the object and assigns it via AddProperty(toParent, "oBizobj", loBiz) and vice versa AddProperty(loBiz, "oParent", toParent). There's a twist, a couple of them actually. The code gets called twice, for some reason, first time without 2nd parameter, and the first parameter has no properties, or they are blank, etc - practically unusable. Second time is the charm, and I'm thinking of getting rid of the 2nd parameter, it can be passed as a property of the first.

Other quirks - when editing this class, or a form containing it, sometimes the makebizobj.prg runs in edit mode, complaining about this and that, of course. Also, while it runs, this, thisform etc are unavailable. May as well try to pass a this as a parameter, just to see if that may simplify matters.

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