Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing an App from ending
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00347383
Message ID:
00348268
Views:
21
Chris,

Use a framework that handles your forms for you. TasTrade is an example of such a framework (ships with VFP).

Don't associate the ON SHUTDOWN with your menu. Have your menu call the Shutdown method of an application maanger class that will then iterrate through all open fomrs and try to shut them down. If the manager cannot shut all the forms it simply stops the application shutdown.

To succeed with this something has to be keeping track of the forms. You can do that with the manager object or you can use the _screen.Forms() collection as in;
* AppMgr ShutDown Method
LOCAL llReturn
llReturn = .T.
FOR EACH oForm IN _screen.forms
   IF NOT oForm.Release()
      llReturn = .F.
      EXIT
   ENDIF
ENDFOR
RETURN llReturn
Now just call AppMgr.ShutDown() and if it returns .F. stop the process otherwise shut the app down with a CLEAR EVENTS.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform