Hi Jeff,
>I am trying to use GetLastError() to get error info on api functions called from vfp7. It seems no matter what type of error that I try to raise the error code retrieved by GetLastError() has not changed, even if I use SetLastError() to change it.
These API functions are not reliable when used from Visual FoxPro. The reason is that VFP itself makes API calls which overwrites any value you set as the error code or the error code Windows set in the last API call. For example, GetLastError() usually doesn't work in a VFP DLL COM server. SetLastError() only works if you call GetLastError() in the very next line. If you enter both calls separately in the Command Window, VFP calls some API functions inbetween and the value is lost.
Christof
--
Christof