Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing Form when Adding a Custom Object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00128281
Message ID:
00128286
Vues:
18
>I have a form which has a property (bObject) in it. On the load event I have the following code:
>
>set proc to myCustomObj additive
>this.bObject = creatObject('myObj')
>
>All works fine if I include the following in the unload event.
>this.bObject.destroy()
>this.bObject = .null.
>
>If I use the 'X' in the corner, the form will not close without 'CANCEL' from the command prompt. Clicking the 'X' does not cause the unload to fire. Neither does it fire the 'release'.
>
>How can I get around this?

Robert,

First, don't bother calling the object's destroy it doesn't do anything. Second, the form's Unload is too late, move the code to NULKL the rpoprety to the form's Destroy event.

Third, is there any reason why you can't use the form's AddObject() to create your object. Using that method will obviate all of the nulling stuff because the form will destroy the object automatically.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform