Question:You write the following custom exception class named CustomException.
Public Class CustomException
Inherits ApplicationException
Public Shared COR_E_ARGUMENT As Int32 = &H80070057
Public Sub New(ByVal strMessage As String)
MyBase.New(strMessage)
HResult = COR_E_ARGUMENT
End Sub
End Class
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 Return Marshal.GetExceptionForHR( _ CustomException.COR_E_ARGUMENT) 

C Throw New CustomException("Argument is out of bounds") 

D Marshal.ThrowExceptionForHR( _ CustomException.COR_E_ARGUMENT) 

+ Answer
+ Report
Total Preview: 837

Copyright © 2024. Powered by Intellect Software Ltd