Package com.ms.com |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class ComFailException extends ComException { // Constructors public ComFailException(int hr) public ComFailException(int hr, String message) public ComFailException(int hr, String source, String helpFile, int helpContext) public ComFailException(int hr, String description, String source, String helpFile, int helpContext) public ComFailException() public ComFailException(String message) }
The ComFailException class wraps an HRESULT, the return type for most methods in the Component Object Module (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 Microsoft Win32 SDK. For component-specific errors, refer to 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 |
public ComFailException(int hr)Stores a ComFailException.
Parameter Description hr The HRESULT value to be returned.
public ComFailException(int hr, String message)Stores a ComFailException.
Parameter Description hr The HRESULT value to be returned. message The detail message.
public ComFailException(int hr, String source, String helpFile, int helpContext)Stores a ComFailException.
Parameter Description hr The HRESULT value to be returned. source The source of the ComFailException. helpFile The help file for the ComFailException. helpContext The help context of the ComFailException.
public ComFailException(int hr, String description, String source, String helpFile, int helpContext)Stores a ComFailException.
Parameter Description hr The HRESULT value to be returned. description The detail description. source The source of the ComFailException. helpFile The help file for the ComFailException. helpContext The help context of the ComFailException.
public ComFailException()Stores a ComFailException.
public ComFailException(String message)Stores a ComFailException.
Parameter Description message The detail message.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.