com.moesol.bindings.platform_sdk.component_services
Class LastHRESULT

java.lang.Object
  extended by java.lang.ThreadLocal
      extended by com.moesol.bindings.platform_sdk.component_services.LastHRESULT

public class LastHRESULT
extends ThreadLocal

Provide access to the raw value for the last HRESULT returned by a COM interface call generated by tlb2java. The tlb2java code generator transforms the return type of all [dual] methods so that the [retval] parameter is instead used as the return value. If there is no [retval] parameter void is returned. The original HRESULT is checked for a failure bit and if set a COMException is thrown. Occasionally, the HRESULT encodes additional information beyond success and failure. For example, IEnumVARIANT::Next is documented as returning S_OK, if all elements requested are retrieved, but S_FALSE if there are no errors but fewer elements than requested are returned. In these cases you can use LastHRESULT to get the actual HRESULT.

     LastHRESULT.instance().hresult();
 
This returns the last HRESULT returned by the last COM call on this thread.


Method Summary
 int hresult()
          Get the thread local HRESULT.
 void hresult(int v)
          Set the thread local HRESULT.
protected  Object initialValue()
          The initial value is an array of size one to hold the thread local HRESULT.
static LastHRESULT instance()
           
 
Methods inherited from class java.lang.ThreadLocal
get, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static LastHRESULT instance()

initialValue

protected Object initialValue()
The initial value is an array of size one to hold the thread local HRESULT.

Overrides:
initialValue in class ThreadLocal

hresult

public void hresult(int v)
Set the thread local HRESULT.

Parameters:
v -

hresult

public int hresult()
Get the thread local HRESULT.

Returns:
this threads HRESULT


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.