Question:You write the following custom exception class named CustomException.
public class CustomException : ApplicationException {
public static int COR_E_ARGUMENT =
unchecked((int)0x80070057);
public CustomException(string msg) : base(msg) {
HResult = COR_E_ARGUMENT;
}
}
You need to write a code segment that will use the CustomException class to immediately return control to the COM caller. You also need to ensure that the caller has access to the error code.
Which code segment should you use?
 

A return CustomException.COR_E_ARGUMENT; 

B throw new CustomException("Argument is out of bounds"); 

C Marshal.ThrowExceptionForHR(
CustomException.COR_E_ARGUMENT); 

D return Marshal.GetExceptionForHR(
CustomException.COR_E_ARGUMENT);
"A Composite Solution With Just One Click" - Certification Guaranteed 304 Microsoft 70-536 Exam 

+ Answer
+ Report
Total Preview: 1189

Copyright © 2024. Powered by Intellect Software Ltd