Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object invisible at runtime
Message
De
22/10/2010 09:59:24
 
 
À
22/10/2010 06:24:08
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01486572
Message ID:
01486617
Vues:
40
>>sounds pretty wierd...
>>Gut reactions without any clear reason would be to test if this happens only in the init() of a control already instatianted on the form (my take on your description) or if the same behavior is seen in a class [defined with the changed init] before it is put on the form. Once it's on the form it isn't a class anymore, it is a an object instance, the term is pseudo-subclassing (as you probably know) as can be seen from the way such a method is coded in a prg - not that this should make a difference to the method not working.
>>
>>The other thing I'd check is if the behaviour is the same if the this.addproperty is before the dodefault()
>
>It happened even without any dodefault(). I don't think I need the dodefault(), but I included it later, just in case.

Ok, scratch idea two - assuming you did not have NODEFAULT somewhere in the code run from that init <g>.

>
>I believe this will be difficult to reproduce. The form worked at first, and started to do strange things only after I changed code - completely unrelated, apparently - in some other part of the form.

Still, having a very tiny repro and some of the possible fixes might give you an idea what is happening. [As I said, I like such puzzles]
>
>Changing the AddProperty() method to the AddProperty() function solved the problem. Naomi pointed me to a thread that had a similar problems - completely different symptoms, but also caused by the AddProperty() method, also in VFP 9 / SP 2. And also solved by changing to the AddProperty() function.

Actually, the mentioned thread would jibe better than your problem with a SWAG coming from the part prototypal nature of vfp. In that thread (only skimmed it) there was not any attempt to first cache the .width to a local and then set the new property from that local - even if Dragan hinted this should be tried. Especially the post Fabio answered fits with that idea IMHO - the "this" needed for "width" might already be partialy corrupted for the special way some of the GUI properties (remember _assign/_Access irregularities and was there not a caveat on Eventbinding ?) work. .Width worked in the debugger, but not when the line was actually run.

This my a scientific helper method called "beating around all the bushes" ;-)
but with luck you get a few more points of differing behaviour
to formulate a hypothesis not mostly drawn from your subconcious ;-)
and tempting the crowd here with code ready to run sometimes works.

And yes, I used .New/AddObject when possible to get object cleaning
or base addproperty() function for the last years...

regards

thomas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform