Marshal::GetHRForLastWin32Error Method ()
.NET Framework (current version)
Returns the HRESULT corresponding to the last error incurred by Win32 code executed using Marshal.
Assembly: mscorlib (in mscorlib.dll)
The target function must have had the setLastError metadata flag set. For example, the SetLastError field of the System.Runtime.InteropServices::DllImportAttribute must be true. The process for setting this flag depends on the source language used: C# and C++ are false by default, but the Declare statement in Visual Basic is true.
SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Show: