Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Will this work?
Message
From
28/07/2003 19:55:49
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Will this work?
Miscellaneous
Thread ID:
00814379
Message ID:
00814379
Views:
33
I'm using VFP 7.0

I'm trying to create a class that lets me add an object to any control, without putting any coding in the control except the 1 line to create the object.
SomeControl.Init()
  createobject( 'myClass', this )

define class myClass as custom
  procedure init()
    lparameters toControl
    this.oControl = toControl
    with this.oControl
      .parent.addobject( 'somename', 'myObject', this )
      .....
    endwith
  procedure destroy()
    with this.oControl
      .....
    endwith
    this.oControl = .null. 
Specifically I want to make sure that I'm correct in my assumptions before I start creating this class.

This would be the sequence of events that interest me:
1. SomeControl.parent.destroy() - automatically releases 'myObject'
2. myObject.destroy() - can still reference SomeControl's properties.
3. myObject.destroy() - then removes the reference to SomeControl.
4. SomeControl.destroy() - has no extra instances, so should have no problem releasing.

Am I correct in my assumtion that SomControl.parent.destroy() would trigger myObject.destroy() before SomeControl.destroy()?
Bill Morris
Next
Reply
Map
View

Click here to load this message in the networking platform