这些通话是否等效?
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
throw new Win32Exception();
它们不是等效的。
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error())
引发COM异常。这可能是System.Runtime.InteropServices.COMException
Win32错误代码,也可能是例外。throw new Win32Exception()
引发Win32异常System.ComponentModel.Win32Exception
。本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句