Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Get/SetLastError
Message
 
À
09/01/2003 20:47:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00740147
Message ID:
00740214
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform