au.com.swz.swttocom.swt.types
Interface IAutomationObject

All Known Implementing Classes:
AutomationComposite, AutomationObjectImpl, IFontDisp, IPictureDisp

public interface IAutomationObject

The IAutomationObject interface provides mechanism to access and retrieve information about an object's methods and properties.

Author:
Mark Richter

Method Summary
 void dispose()
          Disposes the automation object.
 int[] getIDsOfNames(java.lang.String[] names)
          Returns the integer values (IDs) that are associated with the specified names by the IDispatch implementor.
 java.lang.String getLastErrorSWT()
          Returns a description of the last error encountered.
 org.eclipse.swt.ole.win32.Variant getProperty(int dispIdMember)
          Returns the value of the property specified by the dispIdMember.
 org.eclipse.swt.ole.win32.Variant getProperty(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg)
          Returns the value of the property specified by the dispIdMember.
 org.eclipse.swt.ole.win32.Variant getProperty(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg, int[] rgdispidNamedArgs)
          Returns the value of the property specified by the dispIdMember.
 org.eclipse.swt.ole.win32.Variant invoke(int dispIdMember)
          Invokes a method on the OLE Object; the method has no parameters.
 org.eclipse.swt.ole.win32.Variant invoke(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg)
          Invokes a method on the OLE Object; the method has no optional parameters.
 org.eclipse.swt.ole.win32.Variant invoke(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg, int[] rgdispidNamedArgs)
          Invokes a method on the OLE Object; the method has optional parameters.
 void invokeNoReply(int dispIdMember)
          Invokes a method on the OLE Object; the method has no parameters.
 void invokeNoReply(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg)
          Invokes a method on the OLE Object; the method has no optional parameters.
 void invokeNoReply(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg, int[] rgdispidNamedArgs)
          Invokes a method on the OLE Object; the method has optional parameters.
 boolean isDisposed()
          Determines if this automation object has been disposed.
 boolean setProperty(int dispIdMember, org.eclipse.swt.ole.win32.Variant rgvarg)
          Sets the property specified by the dispIdMember to a new value.
 boolean setProperty(int dispIdMember, org.eclipse.swt.ole.win32.Variant[] rgvarg)
          Sets the property specified by the dispIdMember to a new value.
 

Method Detail

getIDsOfNames

int[] getIDsOfNames(java.lang.String[] names)
Returns the integer values (IDs) that are associated with the specified names by the IDispatch implementor. If you are trying to get the names of the parameters in a method, the first String in the names array must be the name of the method followed by the names of the parameters.

Parameters:
names - an array of names for which you require the identifiers
Returns:
integer values that are associated with the specified names in the same order as the names where provided; or null if the names are unknown

dispose

void dispose()
Disposes the automation object. This method releases the IDispatch interface on the OLE Document or ActiveX Control. Do not use the OleAutomation object after it has been disposed.


isDisposed

boolean isDisposed()
Determines if this automation object has been disposed.

Returns:
true if this automation object has been disposed.

getProperty

org.eclipse.swt.ole.win32.Variant getProperty(int dispIdMember)
Returns the value of the property specified by the dispIdMember.

Parameters:
dispIdMember - the ID of the property as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
Returns:
the value of the property specified by the dispIdMember or null

getProperty

org.eclipse.swt.ole.win32.Variant getProperty(int dispIdMember,
                                              org.eclipse.swt.ole.win32.Variant[] rgvarg)
Returns the value of the property specified by the dispIdMember.

Parameters:
dispIdMember - the ID of the property as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
Returns:
the value of the property specified by the dispIdMember or null

getProperty

org.eclipse.swt.ole.win32.Variant getProperty(int dispIdMember,
                                              org.eclipse.swt.ole.win32.Variant[] rgvarg,
                                              int[] rgdispidNamedArgs)
Returns the value of the property specified by the dispIdMember.

Parameters:
dispIdMember - the ID of the property as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
rgdispidNamedArgs - an array of identifiers for the arguments specified in rgvarg; the parameter IDs must be in the same order as their corresponding values; all arguments must have an identifier - identifiers can be obtained using OleAutomation.getIDsOfNames
Returns:
the value of the property specified by the dispIdMember or null

invoke

org.eclipse.swt.ole.win32.Variant invoke(int dispIdMember)
Invokes a method on the OLE Object; the method has no parameters.

Parameters:
dispIdMember - the ID of the method as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
Returns:
the result of the method or null if the method failed to give result information

invoke

org.eclipse.swt.ole.win32.Variant invoke(int dispIdMember,
                                         org.eclipse.swt.ole.win32.Variant[] rgvarg)
Invokes a method on the OLE Object; the method has no optional parameters.

Parameters:
dispIdMember - the ID of the method as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
Returns:
the result of the method or null if the method failed to give result information

invoke

org.eclipse.swt.ole.win32.Variant invoke(int dispIdMember,
                                         org.eclipse.swt.ole.win32.Variant[] rgvarg,
                                         int[] rgdispidNamedArgs)
Invokes a method on the OLE Object; the method has optional parameters. It is not necessary to specify all the optional parameters, only include the parameters for which you are providing values.

Parameters:
dispIdMember - the ID of the method as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
rgdispidNamedArgs - an array of identifiers for the arguments specified in rgvarg; the parameter IDs must be in the same order as their corresponding values; all arguments must have an identifier - identifiers can be obtained using OleAutomation.getIDsOfNames
Returns:
the result of the method or null if the method failed to give result information

invokeNoReply

void invokeNoReply(int dispIdMember)
Invokes a method on the OLE Object; the method has no parameters. In the early days of OLE, the IDispatch interface was not well defined and some applications (mainly Word) did not support a return value. For these applications, call this method instead of calling public void invoke(int dispIdMember).

Parameters:
dispIdMember - the ID of the method as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
Throws:
org.eclipse.swt.SWTException -
  • ERROR_ACTION_NOT_PERFORMED when method invocation fails

invokeNoReply

void invokeNoReply(int dispIdMember,
                   org.eclipse.swt.ole.win32.Variant[] rgvarg)
Invokes a method on the OLE Object; the method has no optional parameters. In the early days of OLE, the IDispatch interface was not well defined and some applications (mainly Word) did not support a return value. For these applications, call this method instead of calling public void invoke(int dispIdMember, Variant[] rgvarg).

Parameters:
dispIdMember - the ID of the method as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
Throws:
org.eclipse.swt.SWTException -
  • ERROR_ACTION_NOT_PERFORMED when method invocation fails

invokeNoReply

void invokeNoReply(int dispIdMember,
                   org.eclipse.swt.ole.win32.Variant[] rgvarg,
                   int[] rgdispidNamedArgs)
Invokes a method on the OLE Object; the method has optional parameters. It is not necessary to specify all the optional parameters, only include the parameters for which you are providing values. In the early days of OLE, the IDispatch interface was not well defined and some applications (mainly Word) did not support a return value. For these applications, call this method instead of calling public void invoke(int dispIdMember, Variant[] rgvarg, int[] rgdispidNamedArgs).

Parameters:
dispIdMember - the ID of the method as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
rgdispidNamedArgs - an array of identifiers for the arguments specified in rgvarg; the parameter IDs must be in the same order as their corresponding values; all arguments must have an identifier - identifiers can be obtained using OleAutomation.getIDsOfNames
Throws:
org.eclipse.swt.SWTException -
  • ERROR_ACTION_NOT_PERFORMED when method invocation fails

setProperty

boolean setProperty(int dispIdMember,
                    org.eclipse.swt.ole.win32.Variant rgvarg)
Sets the property specified by the dispIdMember to a new value.

Parameters:
dispIdMember - the ID of the property as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - the new value of the property
Returns:
true if the operation was successful

setProperty

boolean setProperty(int dispIdMember,
                    org.eclipse.swt.ole.win32.Variant[] rgvarg)
Sets the property specified by the dispIdMember to a new value.

Parameters:
dispIdMember - the ID of the property as specified by the IDL of the ActiveX Control; the value for the ID can be obtained using OleAutomation.getIDsOfNames
rgvarg - an array of arguments for the method. All arguments are considered to be read only unless the Variant is a By Reference Variant type.
Returns:
true if the operation was successful

getLastErrorSWT

java.lang.String getLastErrorSWT()
Returns a description of the last error encountered.

Returns:
a description of the last error encountered