GetLastError

  • Thread starter Thread starter nicolasr
  • Start date Start date
N

nicolasr

Hi,
I'm quite new to the .net framework and try to port some old code to csharp.
In my code I have a call to a Win32 API function which returns error
information by setting the last Win32 error code. I found a
GetLastWin32Error() in the Marshal class which seems to do what
GetLastError() did.
Can anyone tell me how to get a string from the returned error code?
In Win32 API code I used FormatMessage(), in Delphi SysErrorMessage().
Anything similar in the .net class library?

thanks,
Nick
 
Nick,

Take a look at the Win32Exception class, which uses the GetLastWin32Error
method when instantiated.
 
Back
Top