Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Will this work?
Message
De
28/07/2003 19:55:49
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Will this work?
Divers
Thread ID:
00814379
Message ID:
00814379
Vues:
34
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform