题目类型:[单选] 您要写下面的名为 CustomException的自定义异常类public class CustomException : ApplicationException { public static int COR_E_ARGUMENT = unchecked((int)0x80070057); public CustomException(string msg) : base(msg){ HResult = COR_E_ARGUMENT; }}您需要编写一段代码,这段代码要使用ustomException 类,并且要迅速返回控制权给COM 调用方法。 您应该使用哪个代码?()
A、return Marshal.GetExceptionForHR(CustomException.COR_E_ARGUMENT);
B、return CustomException.COR_E_ARGUMENT;
C、Marshal.ThrowExceptionForHR(CustomException.COR_E_ARGUMENT);
D、throw new CustomException(“Argument is out of bounds”)
网友回答
参考答案: D
试题难度:★★☆
参考解析: