Package com.ms.com Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class ComFailException

Constructors

public class com.ms.com.ComFailException
    extends com.ms.com.ComException
{
    // Constructors
    public ComFailException();
    public ComFailException(int hr);
    public ComFailException(String message);
    public ComFailException(int hr, String message);

}

ComFailException indicates a failure. The exception object wraps an HRESULT, the return type for most methods in the Component Object Model (COM). The default value of the HRESULT stored in a ComFailException is E_FAIL (0x80004005L).

The values of system-defined HRESULTs can be found in WINERROR.H, included with the Win32 SDK. For component-specific errors, see the documentation associated with the component.

For system-defined errors, the detail message stored in the ComException object is the string returned by the Win32 API function FormatMessage, which returns a brief message associated with the error. This detail message can be retrieved by calling getMessage (defined by the Throwable class).

The following table lists the values of some common HRESULTs:
Error Value
E_UNEXPECTED (Unexpected failure) 0x8000FFFF
E_NOTIMPL (Not implemented) 0x80004001
E_OUTOFMEMORY (Ran out of memory) 0x8007000E
E_INVALIDARG (One or more arguments are invalid) 0x80070057
E_NOINTERFACE (No such interface supported) 0x80004002
E_POINTER (Invalid pointer) 0x80004003
E_HANDLE (Invalid handle) 0x80070006
E_ABORT (Operation aborted) 0x80004004
E_FAIL (Unspecified error) 0x80004005
E_ACCESSDENIED (General access denied error) 0x80070005
E_NOTIMPL (Not implemented) 0x80000001
DISP_E_UNKNOWNINTERFACE (Unknown interface) 0x80020001
DISP_E_MEMBERNOTFOUND (Member not found) 0x80020003
DISP_E_PARAMNOTFOUND (Parameter not found) 0x80020004
DISP_E_TYPEMISMATCH (Type mismatch) 0x80020005
DISP_E_UNKNOWNNAME (Unknown name) 0x80020006
DISP_E_NONAMEDARGS (No named arguments) 0x80020007
DISP_E_BADVARTYPE (Bad variable type) 0x80020008
DISP_E_EXCEPTION (Exception occurred) 0x80020009
DISP_E_OVERFLOW (Out of present range) 0x8002000A
DISP_E_BADINDEX (Invalid index) 0x8002000B
DISP_E_UNKNOWNLCID (Memory is locked) 0x8002000C
DISP_E_ARRAYISLOCKED (Memory is locked) 0x8002000D
DISP_E_BADPARAMCOUNT (Invalid number of parameters) 0x8002000E
DISP_E_PARAMNOTOPTIONAL (Parameter not optional) 0x8002000F
DISP_E_BADCALLEE (Invalid callee) 0x80020010
DISP_E_NOTACOLLECTION (Does not support a collection) 0x80020011

See also ComException, ComSuccessException, package com.ms.com


Constructors


ComFailException

public ComFailException( );
public ComFailException( int hr );
public ComFailException( String message );
public ComFailException( int hr, String message );

Constructs a new ComFailException object. Throw a ComFailException object in order to signal an error condition when implementing a COM class using Java.

ParameterDescription
hr The HRESULT to return.
message The detail message.



Top© 1996 Microsoft Corporation. All rights reserved.