欢迎来到易学考试网 易学考试官网
全部科目 > 微软认证考试 > MCPD > MCPD(70-536)

单项选择题

您要写下面的名为 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”);

点击查看答案

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题