Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Get/SetLastError
Message
 
To
09/01/2003 20:47:32
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00740147
Message ID:
00740214
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform