Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 and Object Destruction.
Message
De
19/01/1999 20:26:36
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
VFP6 and Object Destruction.
Divers
Thread ID:
00177849
Message ID:
00177849
Vues:
68
Does VFP6 releasse objects differently from previous versions?

I am trying to recompile my MenuLib library for VFP6 and I'm having a problem.

Since considering the problem, I have decided that I've made an OO mistake in the way the system works, but the code was sound enough in VFP3 & 5.

Every menu object has a Children property, containing the number of immediate child menu objects. When a child menu item is released, it does something in the Destroy method like:

THIS.Parent.Children = THIS.Parent.Children - 1

I am getting an error telling me that Parent is an invalid reference. If I debug, then sure enough in the watch window, THIS.Parent cannot be evaluated.

I'll probably get around this by using the RemoveObject method of the parent menu item to decrease its own Children counter, which is probably more 'right-on' OO wise.

Anyway, it's a bit weird and I would welcome any comments.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform