| Package com.ms.com |
Previous |
Microsoft Packages |
Index |
Next |
public abstract class com.ms.com.ComException
extends RuntimeException
{
// Constructors
public ComException();
public ComException(int hr);
public ComException(String message);
public ComException(int hr, String message);
// Methods
public int getHResult();
}
This is the Java class that wraps an HRESULT, the return type for most methods in the Component Object Model (COM). When calling COM methods from Java, you catch ComException objects to handle error conditions. Note that ComException is derived from RuntimeException, so the compiler does not check whether methods throw ComException objects or not; it is up to your discretion as to when you should use try-catch blocks.
When implementing COM classes using Java, ComException objects are thrown to signal error conditions. Since ComException is an abstract class, a ComException object cannot be constructed directly. Instead, either a ComFailException object or a ComSuccessException object can be constructed.
See also RuntimeException, ComFailException, ComSuccessException, package com.ms.com
public ComException( ); public ComException( int hr ); public ComException( String message ); public ComException( int hr, String message );Constructs a new ComException object. Because ComException is an abstract class, this constructor is called only by the constructors of the classes derived from ComException.
Parameter Description hr HRESULT value to be returned. message Detail message.
public int getHResult( );Retrieves the HRESULT returned by the COM method. Call this method when catching a ComException thrown by a COM method.
| © 1997 Microsoft Corporation. All rights reserved. Terms of Use. |