Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 and Object Destruction.
Message
From
19/01/1999 20:26:36
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
VFP6 and Object Destruction.
Miscellaneous
Thread ID:
00177849
Message ID:
00177849
Views:
69
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
Next
Reply
Map
View

Click here to load this message in the networking platform