Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Files using ShFileOperation
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00727693
Message ID:
00728642
Views:
39
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform