1. GetLastError
- Posted by Mark Smith <markrsmith at BTINTERNET.COM> Dec 23, 1998
- 317 views
I've noticed in the wininet.dll documentation that there is a general win32 function called GetLast Error which gives details of why a particular function has not succeeded. Has anybody got any Euphoria code that accesses GetLastError and gives details of the errors. TIA Mark Smith Mark's Leisure Zone http://www.btinternet.com/~markrsmith
2. Re: GetLastError
- Posted by Daniel Berstein <daber at PAIR.COM> Dec 23, 1998
- 313 views
At 01:20 p.m. 23-12-98 , you wrote: >I've noticed in the wininet.dll documentation that there is a general >win32 function called GetLast Error which gives details of why a >particular function has not succeeded. > >Has anybody got any Euphoria code that accesses GetLastError and gives >details of the errors. GetLastError can be found on KERNEL32.DLL. Use the Win32 demos to understand how to link a DLL function. Here the reference for GetLastError from Windows SDK: The GetLastError function returns the calling thread's last-error code value. The last-error code is maintained on a per-thread basis. Multiple threads do not overwrite each other's last-error code. DWORD GetLastError(VOID) Parameters This function has no parameters. Return Values The return value is the calling thread's last-error code value. Functions set this value by calling the SetLastError function. The Return Value section of each reference page notes the conditions under which the function sets the last-error code. Remarks You should call the GetLastError function immediately when a function's return value indicates that such a call will return useful data. That is because some functions call SetLastError(0) when they succeed, wiping out the error code set by the most recently failed function. Most functions in the Win32 API that set the thread's last error code value set it when they fail; a few functions set it when they succeed. Function failure is typically indicated by a return value error code such as FALSE, NULL, 0xFFFFFFFF, or -1. Some functions call SetLastError under conditions of success; those cases are noted in each function's reference page. Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for application-defined error codes; no system error code has this bit set. If you are defining an error code for your application, set this bit to one. That indicates that the error code has been defined by an application, and ensures that your error code does not conflict with any error codes defined by the operating system. To obtain an error string for operating system error codes, use the FormatMessage function. For a complete list of error codes, see the WINNT.H header file in the Win32 SDK. Regards, Daniel Berstein daber at pair.com
3. Re: GetLastError
- Posted by Mark Smith <markrsmith at BTINTERNET.COM> Dec 23, 1998
- 311 views
- Last edited Dec 24, 1998
-----Original Message----- From: Daniel Berstein <daber at PAIR.COM> Date: 23 December 1998 18:40 > >GetLastError can be found on KERNEL32.DLL. Use >the Win32 demos to understand how to link a DLL function. > >Here the reference for GetLastError from Windows SDK: > <Snip SDK reference> That was excellent Daniel and has helped me get passed the latest stumbling block in my HTTP program. All the error codes are in win.h in the LCC compiler. I'm certainly on a fast track learning curve at the moment. Thanks again for all your help. Mark Smith Mark's Leisure Zone http://www.btinternet.com/~markrsmith