Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy Files using ShFileOperation
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00727693
Message ID:
00728642
Vues:
40
This message has been marked as a message which has helped to the initial question of the thread.
You can use following code.
Declare Integer GetLastError In kernel32.dll 

Declare Integer FormatMessage In kernel32.dll ;
		Integer dwFlags, ;
		String @lpSource, ;
		Integer dwMessageId, ;
		Integer dwLanguageId, ;
		String @lpBuffer, ;
		Integer nSize, ;
		Integer Arguments


...
* your code here
...

? ApiError()
...

FUNCTION ApiError

Local lcErrBuffer, lcErrorMess, liNewErr, lnErrorCode
lcErrBuffer = REPL(CHR(0),1000)
lnErrorCode = GetLastError()
liNewErr = FormatMessage(0x1000;
 	,.NULL., lnErrorCode, 0, @lcErrBuffer,500,0)
lcErrorMess = Transform(lnErrorCode) + "    " + LEFT(lcErrBuffer, AT(CHR(0),lcErrBuffer)- 1 )
RETURN lcErrorMess
>BTW, how can I expand Error Message myself in code, without using Error lookup utility?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform