词条 | OLE Automation |
释义 |
In Microsoft Windows applications programming, OLE Automation (later renamed to simply Automation[1][2]) is an inter-process communication mechanism created by Microsoft. It is based on a subset of Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement the IDispatch interface. It provides an infrastructure whereby applications called automation controllers can access and manipulate (i.e. set properties of or call methods on) shared automation objects that are exported by other applications. It supersedes Dynamic Data Exchange (DDE), an older mechanism for applications to control one another.[3] As with DDE, in OLE Automation the automation controller is the "client" and the application exporting the automation objects is the "server". Contrary to its name, automation objects do not necessarily use Microsoft OLE, although some of Automation objects can be used in OLE environments. The confusion has its roots in Microsoft's earlier definition of OLE, which was previously more or less a synonym of COM. Advantages and limitationsTo ensure interoperability, automation interfaces are limited to use a subset of all COM types.[4][5] Specifically, automation interfaces must use SAFEARRAY instead of raw COM arrays. Automation-compatible COM servers can, however, rely on the in-built OLE marshalling implementation.[6] This avoids the need for additional proxy/stub projects for marshalling out-of-process. UsageAutomation was designed with the ease of scripting in mind, so controllers often provide languages such as Visual Basic for Applications to end users, allowing them to control automation objects via scripts. Automation objects are often written in conventional languages such as C++,[7] where C++ attributes can be used to simplify development,[8] Languages such as Visual Basic and Borland Delphi also provides a convenient syntax for Automation which hides the complexity of the underlying implementation. Type librariesIn order to automate an application, the developer of an automation controller must know the object model that is employed by the target application exporting activation objects.[9] This requires that the developer of the target application publicly document its object model. Development of automation controllers without knowledge of the target application's object model is "difficult to impossible".[10] Because of these complications, Automation components are usually provided with type libraries, which contain metadata about classes, interfaces and other features exposed by an object library. Interfaces are described in Microsoft Interface Definition Language. Type libraries can be viewed using various tools, such as the Microsoft OLE/COM Object Viewer ( Microsoft has publicly documented the object model of all of the applications in Microsoft Office,[15] and some other software developers have also documented the object models of their applications. Object models are presented to automation controllers as type libraries, with their interfaces described in ODL. Language supportAutomation is available for a variety of languages, including, but not limited to:
See also
References1. ^{{cite web|url=http://msdn2.microsoft.com/en-us/library/dt80be78.aspx|title=Automation (MFC)|author=Microsoft Corporation|work=MSDN}} 2. ^{{cite book|author=KruJ.|authorlink=|author2=Wingo, Scott |author3=Shepherd, George |year=1998|title=Programming Microsoft Visual C++ 6.0|edition=5th|chapter=Chapter 25: Automation|publisher=Microsoft Press|location=Redmond, WA|isbn=978-1-57231-857-1}} 3. ^{{cite web|url=http://gmccomb.com/vault/edge/ole.html|title=Using OLE Automation to Control WordPerfect|year=1997|author=Gordon McComb}} — McComb describes how to use OLE Automation instead of DDE to control WordPerfect 4. ^Microsoft MSDN: oleautomation attribute 5. ^Microsoft MSDN: Automation-Compatible Types 6. ^Microsoft MSDN: Marshaling Details (COM) Type Library Marshaling community additions 7. ^{{cite web|url=http://www.cgoakley.org/prog/oleaut.html|title=OLE Automation for C++ programmers|author=Chris Oakley}} 8. ^MSDN Magazine: C++ Attributes: Make COM Programming a Breeze with New Feature in Visual Studio .NET 9. ^1 {{cite web|url=http://webreference.com./js/column55/|title=OLE Automation in JavaScript|work=WebReference|author=Yehuda Shiran and Tomer Shiran}} — despite the title, the article discusses JScript rather than JavaScript 10. ^{{cite journal|url=http://pbdj.sys-con.com/read/170833.htm|title=OLE — Extending the Capabilities of PowerBuilder (Part 2)|author=Bruce Armstrong|date=2006-01-16|journal=PowerBuilder Developers' Journal|volume=12|issue=11}} 11. ^1 {{cite book|author=Appleman, Dan|year=2001|title=Moving to VB.NET: Strategies, Concepts, and Code|chapter=Chapter 15: COM Interop and Accessing the Win32 API|publisher=Apress|isbn=978-1-893115-97-2}} 12. ^{{cite web|url=http://danadler.com/jacob/|title=The JACOB Project|date=2004-10-17}} 13. ^{{cite web|url=http://jsegue.sourceforge.net/|title=jSegue|date=2005-12-14}} 14. ^{{cite web|url=http://j-interop.org/|title=j-Interop Java COM interoperability from any platform}} 15. ^{{cite web|publisher=Microsoft Corporation|work=KnowledgeBase|title=How to find and use Office object model documentation|url=http://support.microsoft.com/?scid=kb;en-us;222101}} 16. ^{{cite web|url=http://msdn.microsoft.com/en-us/library/h31ekh7e.aspx|title=Compiler COM Support|publisher=Microsoft|work=MSDN}} 17. ^{{cite web|url=http://delphi.about.com/od/kbcontrolole/|title=OLE Automation using Delphi|work=About.com}} 18. ^{{cite web |url=http://www.oorexx.org/products.html |title=Open Object Rexx}} 19. ^{{cite journal|url=http://www.foo.be/docs/tpj/issues/vol3_2/tpj0302-0008.html|title=Win32::OLE|author=Jan Dubois|journal=The Perl Journal|volume=3|issue=2|date=Summer 1998}} 20. ^{{cite web|url=http://www.php.net/manual/en/ref.com.php|title=PHP: COM and .Net (Windows)|author=The PHP Group|date=2006-07-25}} 21. ^{{cite web|url=http://sourceforge.net/projects/pywin32/|title=Python for Windows Extensions|author=Mark Hammond}} 22. ^{{cite web|url=http://sourceforge.net/projects/comtypes/|title=Comtypes Python package|author=Sourceforge}} 23. ^{{cite web|url=http://wiki.tcl.tk/ole|title=OLE from a Tcl perspective|author=Tcl programmers}} 24. ^{{cite web|url=http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+Tutorials/OLE~TUTORIAL+WINBATCH~OLE~PROGRAMMING~-~Part~2.txt|title=OLE TUTORIAL WINBATCH OLE PROGRAMMING|author=Stan Littlefield }} External links
title=OLE 2 Programmer's Reference: Creating Programmable Applications with OLE Automation v. 2| series=Programmer's Reference Library| author=Microsoft Corporation| publisher=Microsoft Press|date=December 1993| isbn=978-1-55615-629-8}}
title=Inside OLE| author=Kraig Brockschmidt| publisher=Microsoft Press| year=1995| id=}}
title=OLE Automation Programmer's Reference| series=Programmer's Reference Library| author=Microsoft Corporation| publisher=Microsoft Press| year=1996| isbn=978-1-55615-851-3}}
title=Microsoft Office 2000 Visual Basic for Applications Language Reference| author=Microsoft Corporation| publisher=Microsoft Press| isbn=978-1-57231-955-4| year=1999}} — full printed documentation of the object model of Microsoft Office {{Microsoft Windows components}} 2 : Object-oriented programming|Microsoft application programming interfaces |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。