Java Doc for OleAutomation.java in  » IDE-Eclipse » swt » org » eclipse » swt » ole » win32 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » swt » org.eclipse.swt.ole.win32 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.swt.ole.win32.OleAutomation

OleAutomation
final public class OleAutomation (Code)
OleAutomation provides a generic mechanism for accessing functionality that is specific to a particular ActiveX Control or OLE Document.

The OLE Document or ActiveX Control must support the IDispatch interface in order to provide OleAutomation support. The additional functionality provided by the OLE Object is specified in its IDL file. The additional methods can either be to get property values (getProperty), to set property values (setProperty) or to invoke a method (invoke or invokeNoReply). Arguments are passed around in the form of Variant objects.

Here is a sample IDL fragment:

 interface IMyControl : IDispatch
 {
 [propget, id(0)] HRESULT maxFileCount([retval, out] int *c);
 [propput, id(0)] HRESULT maxFileCount([in] int c);
 [id(1)]	HRESULT AddFile([in] BSTR fileName);
 };
 

An example of how to interact with this extended functionality is shown below:

 OleAutomation automation = new OleAutomation(myControlSite);
 // Look up the ID of the maxFileCount parameter
 int[] rgdispid = automation.getIDsOfNames(new String[]{"maxFileCount"});
 int maxFileCountID = rgdispid[0];
 // Set the property maxFileCount to 100:
 if (automation.setProperty(maxFileCountID, new Variant(100))) {
 System.out.println("Max File Count was successfully set.");
 }
 // Get the new value of the maxFileCount parameter:
 Variant pVarResult = automation.getProperty(maxFileCountID);
 if (pVarResult != null) {
 System.out.println("Max File Count is "+pVarResult.getInt());
 }
 // Invoke the AddFile method
 // Look up the IDs of the AddFile method and its parameter
 rgdispid = automation.getIDsOfNames(new String[]{"AddFile", "fileName"}); 
 int dispIdMember = rgdispid[0];
 int[] rgdispidNamedArgs = new int[] {rgdispid[1]};
 // Convert arguments to Variant objects
 Variant[] rgvarg = new Variant[1];
 String fileName = "C:\\testfile";
 rgvarg[0] = new Variant(fileName);
 // Call the method
 Variant pVarResult = automation.invoke(dispIdMember, rgvarg, rgdispidNamedArgs);
 // Check the return value
 if (pVarResult == null || pVarResult.getInt() != OLE.S_OK){
 System.out.println("Failed to add file "+fileName);
 }
 automation.dispose();
 



Constructor Summary
 OleAutomation(IDispatch idispatch)
    
public  OleAutomation(OleClientSite clientSite)
     Creates an OleAutomation object for the specified client.

Method Summary
public  voiddispose()
     Disposes the automation object.
 intgetAddress()
    
public  StringgetDocumentation(int dispId)
    
public  OleFunctionDescriptiongetFunctionDescription(int index)
    
public  StringgetHelpFile(int dispId)
    
public  int[]getIDsOfNames(String[] names)
     Returns the positive integer values (IDs) that are associated with the specified names by the IDispatch implementor.
public  StringgetLastError()
     Returns a description of the last error encountered.
public  StringgetName(int dispId)
    
public  String[]getNames(int dispId, int maxSize)
    
public  VariantgetProperty(int dispIdMember)
     Returns the value of the property specified by the dispIdMember.
public  VariantgetProperty(int dispIdMember, 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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method.
public  VariantgetProperty(int dispIdMember, 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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method.
public  OlePropertyDescriptiongetPropertyDescription(int index)
    
public  TYPEATTRgetTypeInfoAttributes()
    
public  Variantinvoke(int dispIdMember)
     Invokes a method on the OLE Object; the method has no parameters.
public  Variantinvoke(int dispIdMember, 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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method.
public  Variantinvoke(int dispIdMember, Variant[] rgvarg, int[] rgdispidNamedArgs)
     Invokes a method on the OLE Object; the method has optional parameters.
public  voidinvokeNoReply(int dispIdMember)
     Invokes a method on the OLE Object; the method has no parameters.
public  voidinvokeNoReply(int dispIdMember, Variant[] rgvarg)
     Invokes a method on the OLE Object; the method has no optional parameters.
public  voidinvokeNoReply(int dispIdMember, Variant[] rgvarg, int[] rgdispidNamedArgs)
     Invokes a method on the OLE Object; the method has optional parameters.
public  booleansetProperty(int dispIdMember, Variant rgvarg)
     Sets the property specified by the dispIdMember to a new value.
public  booleansetProperty(int dispIdMember, 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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method.


Constructor Detail
OleAutomation
OleAutomation(IDispatch idispatch)(Code)



OleAutomation
public OleAutomation(OleClientSite clientSite)(Code)
Creates an OleAutomation object for the specified client.
Parameters:
  clientSite - the site for the OLE Document or ActiveX Control whose additional functionality you need to access
exception:
  IllegalArgumentException -
  • ERROR_INVALID_INTERFACE_ADDRESS when called with an invalid client site




Method Detail
dispose
public void dispose()(Code)
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.




getAddress
int getAddress()(Code)



getDocumentation
public String getDocumentation(int dispId)(Code)



getFunctionDescription
public OleFunctionDescription getFunctionDescription(int index)(Code)



getHelpFile
public String getHelpFile(int dispId)(Code)



getIDsOfNames
public int[] getIDsOfNames(String[] names)(Code)
Returns the positive 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 positive integer values that are associated with the specified names in the sameorder as the names where provided; or null if the names are unknown



getLastError
public String getLastError()(Code)
Returns a description of the last error encountered. a description of the last error encountered



getName
public String getName(int dispId)(Code)



getNames
public String[] getNames(int dispId, int maxSize)(Code)



getProperty
public Variant getProperty(int dispIdMember)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames the value of the property specified by the dispIdMember or null



getProperty
public Variant getProperty(int dispIdMember, Variant[] rgvarg)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type. the value of the property specified by the dispIdMember or null
since:
   2.0



getProperty
public Variant getProperty(int dispIdMember, Variant[] rgvarg, int[] rgdispidNamedArgs)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type.
Parameters:
  rgdispidNamedArgs - an array of identifiers for the arguments specified in rgvarg; theparameter IDs must be in the same order as their corresponding values;all arguments must have an identifier - identifiers can be obtained using OleAutomation.getIDsOfNames the value of the property specified by the dispIdMember or null
since:
   2.0



getPropertyDescription
public OlePropertyDescription getPropertyDescription(int index)(Code)



getTypeInfoAttributes
public TYPEATTR getTypeInfoAttributes()(Code)



invoke
public Variant invoke(int dispIdMember)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames the result of the method or null if the method failed to give result information



invoke
public Variant invoke(int dispIdMember, Variant[] rgvarg)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type. the result of the method or null if the method failed to give result information



invoke
public Variant invoke(int dispIdMember, Variant[] rgvarg, int[] rgdispidNamedArgs)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type.
Parameters:
  rgdispidNamedArgs - an array of identifiers for the arguments specified in rgvarg; theparameter IDs must be in the same order as their corresponding values;all arguments must have an identifier - identifiers can be obtained using OleAutomation.getIDsOfNames the result of the method or null if the method failed to give result information



invokeNoReply
public void invokeNoReply(int dispIdMember)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
exception:
  org.eclipse.swt.SWTException -
  • ERROR_ACTION_NOT_PERFORMED when method invocation fails



invokeNoReply
public void invokeNoReply(int dispIdMember, Variant[] rgvarg)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type.
exception:
  org.eclipse.swt.SWTException -
  • ERROR_ACTION_NOT_PERFORMED when method invocation fails



invokeNoReply
public void invokeNoReply(int dispIdMember, Variant[] rgvarg, int[] rgdispidNamedArgs)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type.
Parameters:
  rgdispidNamedArgs - an array of identifiers for the arguments specified in rgvarg; theparameter IDs must be in the same order as their corresponding values;all arguments must have an identifier - identifiers can be obtained using OleAutomation.getIDsOfNames
exception:
  org.eclipse.swt.SWTException -
  • ERROR_ACTION_NOT_PERFORMED when method invocation fails



setProperty
public boolean setProperty(int dispIdMember, Variant rgvarg)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - the new value of the property true if the operation was successful



setProperty
public boolean setProperty(int dispIdMember, Variant[] rgvarg)(Code)
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; thevalue for the ID can be obtained using OleAutomation.getIDsOfNames
Parameters:
  rgvarg - an array of arguments for the method. All arguments are considered to beread only unless the Variant is a By Reference Variant type. true if the operation was successful
since:
   2.0



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.