>This error does not appear when i exit via menu Files/exit.
>You were right to check out the onshutdown procedure. The debugger never showed me that this procedure is called via the x-button.(How did you know???)
Stefan,
I'm not sure, but perhaps the on shutdown fires after the shut down has begun and VFP doesn't allow a suspend there. Try putting a var assignment at the beginning of the on shutdown like Dummy = .T. and then put dummy in teh watch window and set a break point on that.
As for how I kenw that, well the help file says ON SHUTDOWN allows you to assign a procedure to be run when VFP is shutting down. The close box (X) shuts down VFP.