Package com.ms.com |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class ComLib { // Methods protected static native void setDataWrapperSize(Object DataWrapper, int cb) public native static int jcdwSizeOf(Object jcdw) public native static int jcdwClassSizeOf(Class cls) public native static int jcdwOffsetOf(Object jcdw, String fieldName) public native static int jcdwClassOffsetOf(Class cls, String fieldName) public native static void release(Object o) public native static void declareMessagePumpThread() }
The ComLib class contains miscellaneous routines that are used during Java/Component Object Module (COM) integration. All ComLib methods are static.
protected static native void setDataWrapperSize(Object DataWrapper, int cb)Allocates and binds memory to an existing data wrapper.
Return Value:
No return value.
Parameter Description DataWrapper The wrapper that memory is allocated and bound to. cb The number of bytes of memory bound to the data wrapper.
public native static int jcdwSizeOf(Object jcdw)Retrieves the size in bytes of a COM data structure represented by a Java proxy.
Return Value:
Returns the size in bytes of a COM data structure.
Parameter Description jcdw The java proxy to a data structure.
public native static int jcdwClassSizeOf(Class cls)Retrieves the size in bytes of a COM data structure that represents instances of the class.
Return Value:
Returns the size in bytes of a COM data structure.
Parameter Description cls The class object for a java proxy to a data structure.
public native static int jcdwOffsetOf(Object jcdw, String fieldName)Retrieves the offset in bytes of a COM data structure represented by a Java proxy.
Return Value:
Returns the offset in bytes of a COM data structure.
Parameter Description jcdw The java proxy to a data structure. fieldName The name of the COM-mapped field.
public native static int jcdwClassOffsetOf(Class cls, String fieldName)Retrieves the offset in bytes of a COM data structure that represents an instance of a Java proxy class.
Return Value:
Returns the offset in bytes of a COM data structure.
Parameter Description cls The class object for a java proxy to a data structure. fieldName The name of the COM-mapped field.
public native static void release(Object o)Forces Java to release all outstanding reference counts on a native COM object. After releasing the reference counts, any attempts to use the COM object through this Java proxy results in an UnsatisfiedLinkError.
Return Value:
No return value.
Parameter Description o The java proxy to a native COM object. Remarks:
The release method is not usually needed because outstanding reference counts are released through normal garbage collection. This method can be used prior to garbage collection to force Java to release native COM objects early.
Remarks:
This method is asynchronous if the Java proxy wraps a non–thread-safe native COM object that was created on another thread. That is, the actual release may occur after the release method has returned.
public native static void declareMessagePumpThread()Enables apartment model hosting.
Return Value:
No return value.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.