John,
Just to expand a little on Nadya's reply. You have to clear the ON SHUTDOWN handler inside your shutdown handler so that it'll no longer try to intercept the shutdown process.
PROCEDURE CloseDown()
on shutdown
SET SYSMENU TO DEFAULT
frmMain.Unload
CLEAR EVENTS
RETURN
The CLEAR EVENTS will cause program flow to continue to the next line of code after the READ EVENTS.
>Hi
>Below is my code. The problem is my application will not shutdown. And then when I try to quit vfp it will not shutdown either.
>
>This is in my main prg.
>
>CODE
>PUBLIC frmMain as Object
>
>SET PATH TO HOME(1);MENUS;classes;libs;DATA;SOURCE;OTHER;graphics;FORMS;OTHER
>ON SHUTDOWN DO closedown
>SET CLASSLIB TO clsForms.vcx
>frmMain = CreateObject("MainForm")
>frmMain.Show
>READ EVENTS
>
>This is my shutdown procedure
>
>CODE
>PROCEDURE CloseDown()
> SET SYSMENU TO DEFAULT
> frmMain.Unload
> CLEAR EVENTS
> CANCEL
>RETURN