>How do I go about returning a value (such as a success or failure) to Windows from a VFP 5 exe?
>Is this possible?
>Many thanks
>John
John,
VFP will always return a zero indicating that it shut down successfully. This is not much use. You can override this behavior by using the Win32 API. for example to return the error code in gnErrorLevel
DECLARE ExitProcess IN Win32API INTEGER ExitCode
ExitProcess(gnErrorLevel)
This code bypasses all the VFP shutdown code and forces the process to exit immediately. You need to make sure you do all the cleanup before calling ExitProcess (like closing open files, etc.)