com.jniwrapper.win32
Class LastError

java.lang.Object
  extended by com.jniwrapper.win32.LastError

public class LastError
extends java.lang.Object

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


Field Summary
static int ERROR_SUCCESS
           
static int NO_ERROR
           
 
Constructor Summary
LastError()
           
 
Method Summary
static void clearLastErrorCode()
          Clears the last error value.
static java.lang.String getMessage()
          Deprecated. Use the getMessage(long) function instead.
static java.lang.String getMessage(boolean clearStatus)
          Deprecated. Use the getMessage(long) function instead.
static java.lang.String getMessage(long errorCode)
          Searches the system message-table resource(s) for the requested error code message.
static int getValue()
          Deprecated. To retrieve the last error code, use the function invocation result instead. This function does not guarantee that the result value is always correct.
static int getValue(boolean clear)
          Deprecated. To retrieve the last error code, use the result value of the function invocation instead. This function does not guarantee that the result value is correct. To clear the last error value, use the clearLastErrorCode() method.
static void setValue(int value)
          Sets the last error code.
 
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

ERROR_SUCCESS

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

LastError

public LastError()
Method Detail

getValue

public static int getValue()
Deprecated. To retrieve the last error code, use the function invocation result instead. This function does not guarantee that the result value is always correct.

Retrieves the last error code value of the native thread.

Returns:
last error code value.

getValue

public static int getValue(boolean clear)
Deprecated. To retrieve the last error code, use the result value of the function invocation instead. This function does not guarantee that the result value is correct. To clear the last error value, use the clearLastErrorCode() method.

Returns the last error value and clears it depending on the passed parameter.

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

clearLastErrorCode

public static void clearLastErrorCode()
Clears the last error value.


setValue

public static void setValue(int value)
Sets the last error code.

Parameters:
value - the value to set as last error code.

getMessage

public static java.lang.String getMessage()
Deprecated. Use the getMessage(long) function instead.

Returns:
system error message for the last error.

getMessage

public static java.lang.String getMessage(boolean clearStatus)
Deprecated. Use the getMessage(long) function instead.

Returns the system error message and clears it if the passed parameter is true.

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

getMessage

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

Parameters:
errorCode - system error code returned by the function.invoke method.
Returns:
system error message for the passed code.