Package com.ibm.di.automation
Class IDispatch
- java.lang.Object
-
- com.ibm.di.automation.IDispatch
-
public class IDispatch extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description int
m_pIDispatch
-
Constructor Summary
Constructors Modifier Constructor Description IDispatch()
Default c'tor This class is a wrapper for COM's IDispatch This class can be used in javascript, through a predefined javascript object, COMProxy.protected
IDispatch(int pDisp)
c'tor this only gets called from JNIIDispatch(java.lang.String progid)
This class is a wrapper for COM's IDispatch It can be used in javascript, through a predefined javascript object, COMProxy.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VARIANT
call(java.lang.Object disp, java.lang.String name, java.lang.Object[] args)
Calls invoke.static java.lang.String
CLSIDfromProgID(java.lang.String progID)
Gets CLSID for the specified progIDvoid
createInstance(java.lang.String progid)
Creates a single uninitialized object of the class associated with a specified PROGIDstatic java.util.Vector
enumMethods(java.lang.Object disp)
enumerate methods/properties for the specified dispatch interfaceprotected void
finalize()
static int[]
getIDsOfNames(java.lang.Object disp, int lcid, java.lang.String[] names)
Native call, calls contained COM's IDispatch's(m_pIDispatch) 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 IDispatch::Invoke.static VARIANT
invoke(java.lang.Object disp, int dispID, int wFlags, java.lang.Object[] oArg, int[] uArgErr)
Provides access to properties and methods exposed by an object.static VARIANT
invoke(java.lang.Object disp, java.lang.String name, int dispID, int lcid, int wFlags, java.lang.Object[] oArg, int[] uArgErr)
Provides access to properties and methods exposed by an object.static VARIANT
invoke(java.lang.Object disp, java.lang.String name, int wFlags, java.lang.Object[] oArg, int[] uArgErr)
Provides access to properties and methods exposed by an object.static void
invokeSubv(java.lang.Object disp, java.lang.String name, int dispID, int lcid, int wFlags, VARIANT[] vArg, int[] uArgErr)
eliminate _Guid arg in the invoke callstatic VARIANT
invokev(java.lang.Object disp, int dispID, int wFlags, VARIANT[] vArg, int[] uArgErr)
Calls invoke for the property/method exposed by the objectstatic VARIANT
invokev(java.lang.Object disp, java.lang.String name, int dispID, int lcid, int wFlags, VARIANT[] vArg, int[] uArgErr)
Native call, calls contained COM's IDispatch's(m_pIDispatch) invokestatic VARIANT
invokev(java.lang.Object disp, java.lang.String name, int wFlags, VARIANT[] vArg, int[] uArgErr)
Calls invoke for the property/method exposed by the objectstatic VARIANT
objectToVariant(java.lang.Object o)
Converts an object to VARIANT, so that it can be passed to various function callsstatic VARIANT[]
objectToVariant(java.lang.Object[] o)
Converts an array of objects to array of VARIANTs, so that it can be passed to various function callsIDispatch
QueryInterface(java.lang.String iid)
Native call, calls contained COM's IDispatch's(m_pIDispatch)QueryInterfacevoid
release()
call this to explicitly release the com object before gc Native call, calls contained COM's IDispatch's(m_pIDispatch) Release Decrements reference count.
-
-
-
Constructor Detail
-
IDispatch
public IDispatch()
Default c'tor This class is a wrapper for COM's IDispatch This class can be used in javascript, through a predefined javascript object, COMProxy.
-
IDispatch
public IDispatch(java.lang.String progid)
This class is a wrapper for COM's IDispatch It can be used in javascript, through a predefined javascript object, COMProxy. COMProxy is a predefined instance of com.ibm.di.automation.IDispatch usage : system.createCOMInstance(String progID) calls new IDispatch(progID)- Parameters:
progid
- the progID (Programmatic IDentifier)is a string that uniquely identifies the COM object, stored in the registry and is of the form: Project.ClassName
-
IDispatch
protected IDispatch(int pDisp)
c'tor this only gets called from JNI- Parameters:
pDisp
- pointer to pointer to COM's IDispatch
-
-
Method Detail
-
objectToVariant
public static VARIANT objectToVariant(java.lang.Object o) throws COMError
Converts an object to VARIANT, so that it can be passed to various function calls- Parameters:
o
- object to be converted to VARIANT- Returns:
- VARIANT equivalent of o
- Throws:
COMError
- throws COMError if o cannot be converted to VARIANT
-
objectToVariant
public static VARIANT[] objectToVariant(java.lang.Object[] o) throws COMError
Converts an array of objects to array of VARIANTs, so that it can be passed to various function calls- Parameters:
o
- array of objects to be converted to VARIANT- Returns:
- array of VARIANTs
- Throws:
COMError
- throws COMError if o cannot be converted to VARIANT
-
QueryInterface
public IDispatch QueryInterface(java.lang.String iid) throws COMError
Native call, calls contained COM's IDispatch's(m_pIDispatch)QueryInterface- Parameters:
iid
- Identifier of the interface being requested- Returns:
- Returns pointers to supported interfaces
- Throws:
COMError
-
createInstance
public void createInstance(java.lang.String progid) throws COMError
Creates a single uninitialized object of the class associated with a specified PROGID- Parameters:
progid
- the progID (Programmatic IDentifier)- Throws:
COMError
- if instance cannot be created
-
release
public void release()
call this to explicitly release the com object before gc Native call, calls contained COM's IDispatch's(m_pIDispatch) Release Decrements reference count.
-
invokeSubv
public static void invokeSubv(java.lang.Object disp, java.lang.String name, int dispID, int lcid, int wFlags, VARIANT[] vArg, int[] uArgErr) throws COMError
eliminate _Guid arg in the invoke call- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)name
- name of method/property to be invokeddispID
- Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifierlcid
- The locale context in which to interpret arguments, currently only LOCALE_SYSTEM_DEFAULT is supportedwFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFvArg
- array of arguments to be passed to the method invokeduArgErr
- The index within rgvarg of the first argument that has an error- Throws:
COMError
- if the method cannot be invoked
-
getIDsOfNames
public static int[] getIDsOfNames(java.lang.Object disp, int lcid, java.lang.String[] names) throws COMError
Native call, calls contained COM's IDispatch's(m_pIDispatch) 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 IDispatch::Invoke.- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)lcid
- The locale context in which to interpret arguments, currently only LOCALE_SYSTEM_DEFAULT is supportednames
- array of method names- Returns:
- Caller-allocated array, each element of which contains an identifier (ID) corresponding to one of the names passed in the names array. The first element represents the member name. The subsequent elements represent each of the member's parameters.
- Throws:
COMError
-
call
public static VARIANT call(java.lang.Object disp, java.lang.String name, java.lang.Object[] args) throws COMError
Calls invoke. Invokes the method specified.- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)name
- name of the method/property to be invoked.args
- array of arguments to the method- Returns:
- return value of the method invoked
- Throws:
COMError
-
invoke
public static VARIANT invoke(java.lang.Object disp, java.lang.String name, int dispID, int lcid, int wFlags, java.lang.Object[] oArg, int[] uArgErr) throws COMError
Provides access to properties and methods exposed by an object.- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)name
- name of the method/property to be invoked.dispID
- Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifierlcid
- The locale context in which to interpret arguments, currently only LOCALE_SYSTEM_DEFAULT is supportedwFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFoArg
- array of argumentsuArgErr
- The index within rgvarg of the first argument that has an error- Returns:
- return value of the method invoked
- Throws:
COMError
-
invoke
public static VARIANT invoke(java.lang.Object disp, java.lang.String name, int wFlags, java.lang.Object[] oArg, int[] uArgErr) throws COMError
Provides access to properties and methods exposed by an object.- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)name
- name of the method/property to be invoked.wFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFoArg
- array of argumentsuArgErr
- The index within rgvarg of the first argument that has an error- Returns:
- return value of the method invoked
- Throws:
COMError
-
invoke
public static VARIANT invoke(java.lang.Object disp, int dispID, int wFlags, java.lang.Object[] oArg, int[] uArgErr) throws COMError
Provides access to properties and methods exposed by an object.- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)dispID
- Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifierwFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFoArg
- array of argumentsuArgErr
- The index within rgvarg of the first argument that has an error- Returns:
- return value of the method invoked
- Throws:
COMError
-
invokev
public static VARIANT invokev(java.lang.Object disp, java.lang.String name, int dispID, int lcid, int wFlags, VARIANT[] vArg, int[] uArgErr) throws COMError
Native call, calls contained COM's IDispatch's(m_pIDispatch) invoke- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)name
- name of the method/property to be invoked.dispID
- Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifierlcid
- The locale context in which to interpret arguments, currently only LOCALE_SYSTEM_DEFAULT is supportedwFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFvArg
- array of argumentsuArgErr
- The index within rgvarg of the first argument that has an error- Returns:
- return value of the method invoked
- Throws:
COMError
-
invokev
public static VARIANT invokev(java.lang.Object disp, java.lang.String name, int wFlags, VARIANT[] vArg, int[] uArgErr) throws COMError
Calls invoke for the property/method exposed by the object- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)name
- name of the method/property to be invoked.wFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFvArg
- array of argumentsuArgErr
- The index within rgvarg of the first argument that has an error- Returns:
- return value of the method invoked
- Throws:
COMError
-
invokev
public static VARIANT invokev(java.lang.Object disp, int dispID, int wFlags, VARIANT[] vArg, int[] uArgErr) throws COMError
Calls invoke for the property/method exposed by the object- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)dispID
- Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifierwFlags
- Flags describing the context of the Invoke call, include: Value Description 1>DISPATCH_METHOD 2>DISPATCH_PROPERTYGET 3>DISPATCH_PROPERTYPUT 4>DISPATCH_PROPERTYPUTREFvArg
- array of argumentsuArgErr
- The index within rgvarg of the first argument that has an error- Returns:
- return value of the method invoked
- Throws:
COMError
-
CLSIDfromProgID
public static java.lang.String CLSIDfromProgID(java.lang.String progID) throws COMError
Gets CLSID for the specified progID- Parameters:
progID
- the progID (Programmatic Identifier) for which CLSID is requested- Returns:
- CLSID
- Throws:
COMError
-
enumMethods
public static java.util.Vector enumMethods(java.lang.Object disp) throws COMError
enumerate methods/properties for the specified dispatch interface- Parameters:
disp
- java IDispatch(or COMProxy) object, obtained as a result of system.createCOMInstance(String progID)- Returns:
- vector containing lest of methods/property names
- Throws:
COMError
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
-