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

Re: GetLastError by CT

CT
Mon Aug 11 01:57:10 CDT 2003

Nick,

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

--
Carsten Thomsen
http://www.apress.com/book/bookDisplay.html?bID=105
"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message
news:OjtP4Q5XDHA.2648@TK2MSFTNGP09.phx.gbl...
> 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
>
>



Re: GetLastError by nicolasr

nicolasr
Mon Aug 11 04:28:57 CDT 2003

thanks,
that's what I was looking for.

Nick