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

public Class CallbackProxy

extends Object
implements IDispatchCallback
Class Inheritance
All Implemented Interfaces
com.sun.jna.platform.win32.COM.IDispatchCallback, com.sun.jna.platform.win32.COM.IUnknownCallback, com.sun.jna.platform.win32.COM.IUnknown, com.sun.jna.platform.win32.COM.IDispatch
Known Direct Subclasses
com.sun.jna.platform.win32.COM.util.Factory.CallbackProxy2
Imports
java.lang.reflect.Method, .InvocationTargetException, java.util.ArrayList, .HashMap, .List, .Map, com.sun.jna.Pointer, .WString, com.sun.jna.platform.win32.Guid.IID, .Guid.REFIID, .OaIdl.DISPID, .OaIdl.DISPIDByReference, .OaIdl.EXCEPINFO, .OleAuto.DISPPARAMS, .Variant, .Variant.VARIANT, .WinDef.LCID, .WinDef.UINT, .WinDef.UINTByReference, .WinDef.WORD, .WinError, .WinNT.HRESULT, com.sun.jna.platform.win32.COM.COMException, .COMUtils, .Dispatch, .DispatchListener, .IDispatchCallback, .Unknown, com.sun.jna.platform.win32.COM.util.annotation.ComEventCallback, .ComInterface, .ComMethod, com.sun.jna.ptr.IntByReference, .PointerByReference

Field Summary

Modifier and TypeField and Description
pack-priv Class<?>
pack-priv IComEventCallbackListener
private static boolean
private static byte
private static double
private static float
private static int
private static long
private static short
public DispatchListener
pack-priv Map<OaIdl.DISPID, Method>
pack-priv ObjectFactory
pack-priv Guid.REFIID

Constructor Summary

AccessConstructor and Description
public
CallbackProxy(ObjectFactory factory, Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener)

Method Summary

Modifier and TypeMethod and Description
public int
private Map<OaIdl.DISPID, Method>
createDispIdMap(Class<?> comEventCallbackInterface)

private Guid.REFIID
createRIID(Class<?> comEventCallbackInterface)

private int
fetchDispIdFromName(ComEventCallback annotation)

Deprecated as a consequence of ComEventCallback being deprecated.
public WinNT.HRESULT
GetIDsOfNames(Guid.REFIID
Reserved for future use. Must be IID_NULL.
riid
,
WString[]
The array of names to be mapped.
rgszNames
,
int
The count of the names to be mapped.
cNames
,
WinDef.LCID
The locale context in which to interpret the names.
lcid
,
OaIdl.DISPIDByReference
Caller-allocated array, each element of which contains an identifier (ID) corresponding to one of the names passed in the rgszNames array. The first element represents the member name. The subsequent elements represent each of the member's parameters.
rgDispId
)

Implements com.sun.jna.platform.win32.COM.IDispatch.GetIDsOfNames.

Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to Invoke.
public Pointer
public WinNT.HRESULT
GetTypeInfo(WinDef.UINT
The type information to return. Pass 0 to retrieve type information for the IDispatch implementation.
iTInfo
,
WinDef.LCID
The locale identifier for the type information. An object may be able to return different type information for different languages. This is important for classes that support localized member names. For classes that do not support localized member names, this parameter can be ignored.
lcid
,
PointerByReference
The requested type information object.
ppTInfo
)

Implements com.sun.jna.platform.win32.COM.IDispatch.GetTypeInfo.

Retrieves the type information for an object, which can then be used to get the type information for an interface.
public WinNT.HRESULT
GetTypeInfoCount(WinDef.UINTByReference
The number of type information interfaces provided by the object. If the object provides type information, this number is 1; otherwise the number is 0.
pctinfo
)

Implements com.sun.jna.platform.win32.COM.IDispatch.GetTypeInfoCount.

Retrieves the number of type information interfaces that an object provides (either 0 or 1).
public WinNT.HRESULT
Invoke(OaIdl.DISPID
Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier.
dispIdMember
,
Guid.REFIID
Reserved for future use. Must be IID_NULL.
riid
,
WinDef.LCID
The locale context in which to interpret arguments. The lcid is used by the GetIDsOfNames function, and is also passed to Invoke to allow the object to interpret its arguments specific to a locale.

Applications that do not support multiple national languages can ignore this parameter. For more information, refer to Supporting Multiple National Languages and Exposing ActiveX Objects.

lcid
,
WinDef.WORD
Flags describing the context of the Invoke call. DISPATCH_METHOD The member is invoked as a method. If a property has the same name, both this and the DISPATCH_PROPERTYGET flag can be set. DISPATCH_PROPERTYGET The member is retrieved as a property or data member. DISPATCH_PROPERTYPUT The member is changed as a property or data member. DISPATCH_PROPERTYPUTREF The member is changed by a reference assignment, rather than a value assignment. This flag is valid only when the property accepts a reference to an object.
wFlags
,
OleAuto.DISPPARAMS.ByReference
Pointer to a DISPPARAMS structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.
pDispParams
,
Variant.VARIANT.ByReference
Pointer to the location where the result is to be stored, or NULL if the caller expects no result. This argument is ignored if DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF is specified.
pVarResult
,
OaIdl.EXCEPINFO.ByReference
Pointer to a structure that contains exception information. This structure should be filled in if DISP_E_EXCEPTION is returned. Can be NULL.
pExcepInfo
,
IntByReference
The index within rgvarg of the first argument that has an error. Arguments are stored in pDispParams->rgvarg in reverse order, so the first argument is the one with the highest index in the array. This parameter is returned only when the resulting return value is DISP_E_TYPEMISMATCH or DISP_E_PARAMNOTFOUND. This argument can be set to null. For details, see Returning Errors.
puArgErr
)

Implements com.sun.jna.platform.win32.COM.IDispatch.Invoke.

Provides access to properties and methods exposed by an object.
pack-priv void
invokeOnThread(final OaIdl.DISPID dispIdMember, final Guid.REFIID riid, WinDef.LCID lcid, WinDef.WORD wFlags, final OleAuto.DISPPARAMS.ByReference pDispParams)

public WinNT.HRESULT
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

comEventCallbackInterfaceback to summary
pack-priv Class<?> comEventCallbackInterface
comEventCallbackListenerback to summary
pack-priv IComEventCallbackListener comEventCallbackListener
DEFAULT_BOOLEANback to summary
private static boolean DEFAULT_BOOLEAN
DEFAULT_BYTEback to summary
private static byte DEFAULT_BYTE
DEFAULT_DOUBLEback to summary
private static double DEFAULT_DOUBLE
DEFAULT_FLOATback to summary
private static float DEFAULT_FLOAT
DEFAULT_INTback to summary
private static int DEFAULT_INT
DEFAULT_LONGback to summary
private static long DEFAULT_LONG
DEFAULT_SHORTback to summary
private static short DEFAULT_SHORT
dispatchListenerback to summary
public DispatchListener dispatchListener
dsipIdMapback to summary
pack-priv Map<OaIdl.DISPID, Method> dsipIdMap
factoryback to summary
pack-priv ObjectFactory factory
listenedToRiidback to summary
pack-priv Guid.REFIID listenedToRiid

Constructor Detail

CallbackProxyback to summary
public CallbackProxy(ObjectFactory factory, Class<?> comEventCallbackInterface, IComEventCallbackListener comEventCallbackListener)

Method Detail

AddRefback to summary
public int AddRef()

Implements com.sun.jna.platform.win32.COM.IUnknown.AddRef.

Annotations
@Override
createDispIdMapback to summary
private Map<OaIdl.DISPID, Method> createDispIdMap(Class<?> comEventCallbackInterface)
Annotations
@SuppressWarnings:deprecation
createRIIDback to summary
private Guid.REFIID createRIID(Class<?> comEventCallbackInterface)
fetchDispIdFromNameback to summary
private int fetchDispIdFromName(ComEventCallback annotation)

Deprecated

as a consequence of ComEventCallback being deprecated. See corresponding docs for further information.

GetIDsOfNamesback to summary
public WinNT.HRESULT GetIDsOfNames(Guid.REFIID riid, WString[] rgszNames, int cNames, WinDef.LCID lcid, OaIdl.DISPIDByReference rgDispId)

Implements com.sun.jna.platform.win32.COM.IDispatch.GetIDsOfNames.

Doc from com.sun.jna.platform.win32.COM.IDispatch.GetIDsOfNames.

Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to Invoke. The dispatch function DispGetIDsOfNames provides a standard implementation of GetIDsOfNames.

Parameters
riid:Guid.REFIID

Reserved for future use. Must be IID_NULL.

rgszNames:WString[]

The array of names to be mapped.

cNames:int

The count of the names to be mapped.

lcid:WinDef.LCID

The locale context in which to interpret the names.

rgDispId:OaIdl.DISPIDByReference

Caller-allocated array, each element of which contains an identifier (ID) corresponding to one of the names passed in the rgszNames array. The first element represents the member name. The subsequent elements represent each of the member's parameters.

Returns:WinNT.HRESULT

status of the operation

Annotations
@Override
getPointerback to summary
public Pointer getPointer()

Implements com.sun.jna.platform.win32.COM.IUnknownCallback.getPointer.

Annotations
@Override
GetTypeInfoback to summary
public WinNT.HRESULT GetTypeInfo(WinDef.UINT iTInfo, WinDef.LCID lcid, PointerByReference ppTInfo)

Implements com.sun.jna.platform.win32.COM.IDispatch.GetTypeInfo.

Doc from com.sun.jna.platform.win32.COM.IDispatch.GetTypeInfo.

Retrieves the type information for an object, which can then be used to get the type information for an interface.

Parameters
iTInfo:WinDef.UINT

The type information to return. Pass 0 to retrieve type information for the IDispatch implementation.

lcid:WinDef.LCID

The locale identifier for the type information. An object may be able to return different type information for different languages. This is important for classes that support localized member names. For classes that do not support localized member names, this parameter can be ignored.

ppTInfo:PointerByReference

The requested type information object.

Returns:WinNT.HRESULT

S_OK Success. DISP_E_BADINDEX The iTInfo parameter was not 0.

Annotations
@Override
GetTypeInfoCountback to summary
public WinNT.HRESULT GetTypeInfoCount(WinDef.UINTByReference pctinfo)

Implements com.sun.jna.platform.win32.COM.IDispatch.GetTypeInfoCount.

Doc from com.sun.jna.platform.win32.COM.IDispatch.GetTypeInfoCount.

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

Parameters
pctinfo:WinDef.UINTByReference

The number of type information interfaces provided by the object. If the object provides type information, this number is 1; otherwise the number is 0.

Returns:WinNT.HRESULT

This method can return one of these values. S_OK Success. E_NOTIMPL Failure.

Annotations
@Override
Invokeback to summary
public WinNT.HRESULT Invoke(OaIdl.DISPID dispIdMember, Guid.REFIID riid, WinDef.LCID lcid, WinDef.WORD wFlags, OleAuto.DISPPARAMS.ByReference pDispParams, Variant.VARIANT.ByReference pVarResult, OaIdl.EXCEPINFO.ByReference pExcepInfo, IntByReference puArgErr)

Implements com.sun.jna.platform.win32.COM.IDispatch.Invoke.

Doc from com.sun.jna.platform.win32.COM.IDispatch.Invoke.

Provides access to properties and methods exposed by an object. The dispatch function DispInvoke provides a standard implementation of Invoke.

Parameters
dispIdMember:OaIdl.DISPID

Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier.

riid:Guid.REFIID

Reserved for future use. Must be IID_NULL.

lcid:WinDef.LCID

The locale context in which to interpret arguments. The lcid is used by the GetIDsOfNames function, and is also passed to Invoke to allow the object to interpret its arguments specific to a locale.

Applications that do not support multiple national languages can ignore this parameter. For more information, refer to Supporting Multiple National Languages and Exposing ActiveX Objects.

wFlags:WinDef.WORD

Flags describing the context of the Invoke call. DISPATCH_METHOD The member is invoked as a method. If a property has the same name, both this and the DISPATCH_PROPERTYGET flag can be set. DISPATCH_PROPERTYGET The member is retrieved as a property or data member. DISPATCH_PROPERTYPUT The member is changed as a property or data member. DISPATCH_PROPERTYPUTREF The member is changed by a reference assignment, rather than a value assignment. This flag is valid only when the property accepts a reference to an object.

pDispParams:OleAuto.DISPPARAMS.ByReference

Pointer to a DISPPARAMS structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.

pVarResult:Variant.VARIANT.ByReference

Pointer to the location where the result is to be stored, or NULL if the caller expects no result. This argument is ignored if DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF is specified.

pExcepInfo:OaIdl.EXCEPINFO.ByReference

Pointer to a structure that contains exception information. This structure should be filled in if DISP_E_EXCEPTION is returned. Can be NULL.

puArgErr:IntByReference

The index within rgvarg of the first argument that has an error. Arguments are stored in pDispParams->rgvarg in reverse order, so the first argument is the one with the highest index in the array. This parameter is returned only when the resulting return value is DISP_E_TYPEMISMATCH or DISP_E_PARAMNOTFOUND. This argument can be set to null. For details, see Returning Errors.

Returns:WinNT.HRESULT

This method can return one of these values. S_OK Success. DISP_E_BADPARAMCOUNT The number of elements provided to DISPPARAMS is different from the number of arguments accepted by the method or property. DISP_E_BADVARTYPE One of the arguments in DISPPARAMS is not a valid variant type. DISP_E_EXCEPTION The application needs to raise an exception. In this case, the structure passed in pexcepinfo should be filled in. DISP_E_MEMBERNOTFOUND The requested member does not exist. DISP_E_NONAMEDARGS This implementation of IDispatch does not support named arguments. DISP_E_OVERFLOW One of the arguments in DISPPARAMS could not be coerced to the specified type. DISP_E_PARAMNOTFOUND One of the parameter IDs does not correspond to a parameter on the method. In this case, puArgErr is set to the first argument that contains the error. DISP_E_TYPEMISMATCH One or more of the arguments could not be coerced. The index of the first parameter with the incorrect type within rgvarg is returned in puArgErr. DISP_E_UNKNOWNINTERFACE The interface identifier passed in riid is not IID_NULL. DISP_E_UNKNOWNLCID The member being invoked interprets string arguments according to the LCID, and the LCID is not recognized. If the LCID is not needed to interpret arguments, this error should not be returned DISP_E_PARAMNOTOPTIONAL A required parameter was omitted.

Annotations
@Override
invokeOnThreadback to summary
pack-priv void invokeOnThread(final OaIdl.DISPID dispIdMember, final Guid.REFIID riid, WinDef.LCID lcid, WinDef.WORD wFlags, final OleAuto.DISPPARAMS.ByReference pDispParams)
QueryInterfaceback to summary
public WinNT.HRESULT QueryInterface(Guid.REFIID refid, PointerByReference ppvObject)

Implements com.sun.jna.platform.win32.COM.IUnknown.QueryInterface.

Annotations
@Override
Releaseback to summary
public int Release()

Implements com.sun.jna.platform.win32.COM.IUnknown.Release.

Annotations
@Override