Top Description Fields Constructors Methods
com.sun.jna.platform.win32.COM

public Class COMException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
com.sun.jna.platform.win32.COM.COMInvokeException
Imports
com.sun.jna.platform.win32.WinNT.HRESULT

Exception class for all COM related classes.
Author
Tobias Wolf, [email protected]

Field Summary

Modifier and TypeField and Description
private final WinNT.HRESULT
private static final long

Constructor Summary

AccessConstructor and Description
public
COMException()

Instantiates a new automation exception.

public
COMException(String
the message
message
)

Instantiates a new automation exception.

public
COMException(Throwable
the cause
cause
)

Instantiates a new automation exception.

public
COMException(String
the message
message
,
Throwable
the cause
cause
)

Instantiates a new automation exception.

public
COMException(String
the message
message
,
WinNT.HRESULT
HRESULT that lead to the creation of the COMException
hresult
)

Instantiates a new automation exception.

Method Summary

Modifier and TypeMethod and Description
public WinNT.HRESULT

Returns:

the HRESULT that lead to thie COMException or NULL if the COMException as not directly caused by a native call
getHresult
()

public boolean

Returns:

true if the exception has an associated HRESULT and that HRESULT matches the supplied error code
matchesErrorCode
(int errorCode)

Field Detail

hresultback to summary
private final WinNT.HRESULT hresult
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

COMExceptionback to summary
public COMException()

Instantiates a new automation exception.

COMExceptionback to summary
public COMException(String message)

Instantiates a new automation exception.

Parameters
message:String

the message

COMExceptionback to summary
public COMException(Throwable cause)

Instantiates a new automation exception.

Parameters
cause:Throwable

the cause

COMExceptionback to summary
public COMException(String message, Throwable cause)

Instantiates a new automation exception.

Parameters
message:String

the message

cause:Throwable

the cause

COMExceptionback to summary
public COMException(String message, WinNT.HRESULT hresult)

Instantiates a new automation exception.

Parameters
message:String

the message

hresult:WinNT.HRESULT

HRESULT that lead to the creation of the COMException

Method Detail

getHresultback to summary
public WinNT.HRESULT getHresult()
Returns:WinNT.HRESULT

the HRESULT that lead to thie COMException or NULL if the COMException as not directly caused by a native call

matchesErrorCodeback to summary
public boolean matchesErrorCode(int errorCode)
Returns:boolean

true if the exception has an associated HRESULT and that HRESULT matches the supplied error code