>Denis,
>
>If you are quiting, and that is what ON SHUTDOWN does, why do you need to CLEAR ALL before you QUIT? I think you can simply remove the clear all line.
>
>The reason you are getting this is because some object is active when the ON SHUTDOWN gets called. When the QUIT is hit the objects will be released but before that they exist and are active. VFP cannot clear an object that is active with the CLEAR command.
I should have been more specific. I am using the wizard to create the project and it is based on the APPWIZ.WZAPPLICATION class. I changed the Shutdown() function in Main.prg to 'cancel' instead of 'Quit' so that in development I stay in VFP, while in the .EXE it returns to Windows.
The Shutdown() function had 'clear all' in it and it worked just fine when my I issued 'oApp.Release()' in my cmdQuit button when it was on a regular form. When I turned the same form into a class, the 'oApp.Release()' left me with the dreaded "Cannot Quit Visual FoxPro' problem. Now in the cmdQuit.Click I have:
ThisForm.Release()
=ShutDown()
and Shutdown contains:
FUNCTION ShutDown
Cleanup()
cancel && changed from QUIT
ENDFUNC
FUNCTION Cleanup
IF CNTBAR("_msysmenu")=7
RETURN
ENDIF
ON ERROR
ON SHUTDOWN
SET CLASSLIB TO
SET PATH TO
CLEAR ALL && causes a 'Cannot clear objects in use'
*!* CLOSE ALL
POP MENU _msysmenu
RETURN
While I am developing I always have to do the following in the command window:
clear all
set sysmenu to default
This only started happening when I turned the form into a class. I just don't understand!
Denis
Dennis Schuette