GetLastError

From Yefu's notes
Jump to: navigation, search

If you use PInvoke calls, set SetLastError=true in the DllImport attribute and then call Marshal.GetLastWin32Error after. Don't try to call GetLastError directly.