Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem closing all forms on shutdown
Message
De
16/01/2004 17:02:48
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Problem closing all forms on shutdown
Divers
Thread ID:
00867688
Message ID:
00867688
Vues:
68
I have a procedure that is called on shutdown. One thing it does is attempt to close all open forms. The problem I am having occurs when it tries to close a form that has opened a modal form.

The code I am using to close the forms is as follows:

FOR i = _screen.formCount TO 1 STEP -1
_screen.forms[i].release
NEXT

I get the error "Cannot clear the object 'myobjectname' because it is in use. Whatever object on the form that called the modal form is the object that gives the problem.

For instance, if my edit button named "cmdEdit" calls a modal form in the click method I would get the message "Cannot clear the object 'cmdEdit' because it is in use. I have even tried referencing the modal form and closing and releasing it before releasing any other forms but that does not seem to help.

If I close the modal form or don't open it at all everything works fine. It seems like there is some sort of reference that the modeless form that calls the modal form is hanging onto.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform