com.jniwrapper.win32
Class LastError

java.lang.Object
  |
  +--com.jniwrapper.win32.LastError

public class LastError
extends java.lang.Object

This class provides status value of the last error and error messages associated with system errors.


Field Summary
static int NO_ERROR
           
 
Constructor Summary
LastError()
           
 
Method Summary
static java.lang.String getMessage()
           
static java.lang.String getMessage(boolean clearStatus)
          Returns system error message and clears it if the passed parameter is true.
static java.lang.String getMessage(int errorCode)
          Searches the system message-table resource(s) for the requested error code message.
static int getValue()
          Retrieves the last-error code value of the native thread.
static int getValue(boolean clear)
          Returns last error value, and clears it depending on the passed parameter.
static void setValue(int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ERROR

public static final int NO_ERROR
See Also:
Constant Field Values
Constructor Detail

LastError

public LastError()
Method Detail

getValue

public static int getValue()
Retrieves the last-error code value of the native thread.

Returns:
last-error code value.

getValue

public static int getValue(boolean clear)
Returns last error value, and clears it depending on the passed parameter.

Parameters:
clear - if true sets last error status to zero, otherwise the status is not unmodified.
Returns:
last-error code value.

setValue

public static void setValue(int value)

getMessage

public static java.lang.String getMessage()
Returns:
system error message for last-error.

getMessage

public static java.lang.String getMessage(boolean clearStatus)
Returns system error message and clears it if the passed parameter is true.

Parameters:
clearStatus - if true the last errror status would be set to zero.
Returns:
last system error message.

getMessage

public static java.lang.String getMessage(int errorCode)
Searches the system message-table resource(s) for the requested error code message.

Parameters:
errorCode - System error code returned by getValue()
Returns:
system error message for the passed code.