Discussion:
GetLastError returns value 6
(too old to reply)
Jack
2005-11-19 21:44:25 UTC
Permalink
Hello,
My code looks like that:
rtn = ReadFile(ComHwnd, indata(1), 65536, nbr, ByVal 0&)
rtn = GetLastError
Function GetLastError returns 6.
What is the meaning of that?
Where can I find the all list of errors?
Thanks,
Jack
MikeD
2005-11-19 22:50:04 UTC
Permalink
Post by Jack
Hello,
rtn = ReadFile(ComHwnd, indata(1), 65536, nbr, ByVal 0&)
rtn = GetLastError
Function GetLastError returns 6.
What is the meaning of that?
GetLastError as in the API function? It's return value is meaningless in
VB. This is because VB itself calls API functions and GetLastError only
reports the last error number that an API function set (for those API
functions that even set it). Because of this, VB's Err object has a
LastDllError property. You *must* use this property to get the error code
that an API function sets.
Post by Jack
Where can I find the all list of errors?
You need to consult the documentation for the specific API function that
you're calling. Now, if you check the Platform SDK on ReadFile, all it says
is that if the function fails (a return value of 0) to call GetLastError to
get extended error information. Below is a link to Win32 system error codes:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp
--
Mike
Microsoft MVP Visual Basic
J French
2005-11-20 09:51:18 UTC
Permalink
Post by Jack
Hello,
rtn = ReadFile(ComHwnd, indata(1), 65536, nbr, ByVal 0&)
rtn = GetLastError
Function GetLastError returns 6.
What is the meaning of that?
Where can I find the all list of errors?
You should have a Win32 Programmer's Help File

I have a backup copy here:

www.jerryfrench.co.uk/utils/win32sdk.zip

Continue reading on narkive:
Loading...