A
active
GetLastWin32Error exposes the Win32 GetLastError API method from
Kernel32.DLL. This method exists because it is not safe to make a direct
platform invoke call to GetLastError to obtain this information. If you want
to access this error code, you must call GetLastWin32Error rather than
writing your own platform invoke definition for GetLastError and calling it.
The common language runtime can make internal calls to APIs that overwrite
the operating system maintained GetLastError.
You can only use this method to obtain error codes if you apply the
System.Runtime.InteropServices.DllImportAttribute to the method signature
and set the SetLastError field to true. The process for this varies
depending upon the source language used: C# and C++ are false by default,
but the Declare statement in Visual Basic is true. For additional
information about the GetLastError and SetLastError Win32 API methods, see
the MSDN Library.
What does the last paragraph mean?
Especially the "...only...if you apply the ..." part
What Declare are they taking about?
I'd like to messagebox only if there is an error.
How can I test for success/failure?
Thanks a lot
Kernel32.DLL. This method exists because it is not safe to make a direct
platform invoke call to GetLastError to obtain this information. If you want
to access this error code, you must call GetLastWin32Error rather than
writing your own platform invoke definition for GetLastError and calling it.
The common language runtime can make internal calls to APIs that overwrite
the operating system maintained GetLastError.
You can only use this method to obtain error codes if you apply the
System.Runtime.InteropServices.DllImportAttribute to the method signature
and set the SetLastError field to true. The process for this varies
depending upon the source language used: C# and C++ are false by default,
but the Declare statement in Visual Basic is true. For additional
information about the GetLastError and SetLastError Win32 API methods, see
the MSDN Library.
What does the last paragraph mean?
Especially the "...only...if you apply the ..." part
What Declare are they taking about?
I'd like to messagebox only if there is an error.
How can I test for success/failure?
Thanks a lot