|
|
||||||||||||||||||||||||||||||||||||
Class ComExceptionpublic abstract class ComException extends RuntimeException { // Fields protected int hr; protected int m_helpContext; protected String m_helpFile; protected String m_source; // Constructors public ComException(int hr); public ComException(int hr, String description); public ComException(int hr, String source, String helpFile, int helpContext); public ComException(int hr, String description, String source, String helpFile, int helpContext); public ComException(); public ComException(String description); // Methods public int getHelpContext(); public String getHelpFile(); public int getHResult(); public String getSource(); } This class wraps an HRESULT, the return type for most methods in the Component Object Model (COM). When you call COM methods from Java, you catch ComException objects to handle error conditions. Because ComException is derived from the RuntimeException class, the compiler does not check whether methods throw ComException objects. Use your discretion as to when you should use try-catch blocks. When implementing COM classes that use Java, ComException objects are thrown to signal error conditions. Because ComException is an abstract class, a ComException object cannot be constructed directly. However, ComFailException objects and ComSuccessException objects are constructed using ComException constructors. RuntimeException | +--ComException ConstructorsComExceptionpublic ComException(int hr); ComExceptionpublic ComException(int hr, String description); ComExceptionpublic ComException(int hr, String source, String helpFile, int helpContext); ComExceptionpublic ComException(int hr, String description, String source, String helpFile, int helpContext); ComExceptionpublic ComException(); ComExceptionpublic ComException(String description); MethodsgetHelpContextpublic int getHelpContext(); getHelpFilepublic String getHelpFile(); getHResultpublic int getHResult(); getSourcepublic String getSource(); Fields
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |