org.isis.jaut
Class ComException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.isis.jaut.ComException
All Implemented Interfaces:
java.io.Serializable

public class ComException
extends java.lang.RuntimeException

A runtime exception thrown by the COM and Automation functions.

See Also:
Serialized Form

Field Summary
static int CO_E_NOTINITIALIZED
           
static int DISP_E_BADVARTYPE
           
static int DISP_E_OVERFLOW
           
static int DISP_E_TYPEMISMATCH
           
static int E_INVALIDARG
           
static int E_OUTOFMEMORY
           
protected  int hResult
          The HRESULT value.
 
Constructor Summary
ComException(int hResult)
          Creates an exception for a COM error code.
 
Method Summary
static java.lang.String formatMessage(int hResult)
          Retrives the error message of an error code.
 int getErrorCode()
          Returns the error code for this exception.
 java.lang.String getMessage()
          Returns the detailed message string for this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

E_INVALIDARG

public static final int E_INVALIDARG
See Also:
Constant Field Values

E_OUTOFMEMORY

public static final int E_OUTOFMEMORY
See Also:
Constant Field Values

DISP_E_BADVARTYPE

public static final int DISP_E_BADVARTYPE
See Also:
Constant Field Values

DISP_E_OVERFLOW

public static final int DISP_E_OVERFLOW
See Also:
Constant Field Values

DISP_E_TYPEMISMATCH

public static final int DISP_E_TYPEMISMATCH
See Also:
Constant Field Values

CO_E_NOTINITIALIZED

public static final int CO_E_NOTINITIALIZED
See Also:
Constant Field Values

hResult

protected int hResult
The HRESULT value.

Constructor Detail

ComException

public ComException(int hResult)
Creates an exception for a COM error code.

Parameters:
hResult - the COM error code (HRESULT or SCODE).
Method Detail

getErrorCode

public int getErrorCode()
Returns the error code for this exception.

Returns:
the COM error code (HRESULT or SCODE) of this exception.

getMessage

public java.lang.String getMessage()
Returns the detailed message string for this exception.

Returns:
the detailed COM error message, if avaiable.
See Also:
formatMessage(int), getErrorCode()

formatMessage

public static java.lang.String formatMessage(int hResult)
Retrives the error message of an error code. This function wraps the FormatMessage Win32 function.

Parameters:
hResult - the COM error code (HRESULT or SCODE).
Returns:
The unformatted error message, or null if no message could be found.