Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with Get/SetLastError
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00740147
Message ID:
00740149
Vues:
16
Hi Jeff,

If you want to set an error code within a procedure and read it later -- the following code always works:

DECLARE INTEGER GetLastError IN kernel32
DECLARE SetLastError IN kernel32 LONG

= SetLastError(13) && ERROR_INVALID_DATA
? GetLastError()

* * *
If you are trying to retrieve an error code after an unsuccessful Win32 call -- this time you should not have a problem either, e.g.:
...
lnResult = AlphaBlend (hDC, lnX,lnY, lnWidth,lnHeight,;
hMemDC, 0,0, lnWidth,lnHeight,;
lnAlphaBlend)

IF lnResult = 0
* 6 = The handle is invalid
* 87 = The parameter is incorrect
? "Error:", GetLastError()
ENDIF
...

* * *
If I am still missing your point, please give more details.
Regards!
Anatoliy Mogylevets
http://www.news2news.com/vfp
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform