>I don´t know exactly the statement where it fails. I think it fails after issuing 'Quit'. The statement before the 'Quit' is a 'Close DLLS'. May this statement be causing the problem ?
If you're suspicious of a problem with CLOSE DLLS, try the following rather than CLOSE DLLS/QUIT:
DECLARE ExitProcess IN WIN32API INTEGER uExitCode
=ExitProcess(0)
I ran into some problems under VFP 3 and VFP 5 with CLOSE DLLS at one point that I never tracked to a specific DLL declaration; I've since used ExitProcess() in preference to QUIT for a number of reasons, not the least being the ability to get VFP to return an error code at termination that can be tested in a batch file or by calling the Win32 API GetExitCodeProcess() call.
Let me know if this works for you; if it does, it would be helpful to know what DLL declarations you use in your application (part of my problem is I use a
lot of API calls in my code, many of which may never be actually needed by a given program; it made tracing the exact cause of my problems very difficult.)