Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem closing all forms on shutdown
Message
From
16/01/2004 17:02:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Problem closing all forms on shutdown
Miscellaneous
Thread ID:
00867688
Message ID:
00867688
Views:
67
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.
Next
Reply
Map
View

Click here to load this message in the networking platform