Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

OLE Automation

From Wikipedia, the free encyclopedia
Inter-process communication mechanism
This articlecontainsinstructions or advice. Wikipedia is not a guidebook; please helprewrite such content to be encyclopedic or move it toWikiversity,Wikibooks, orWikivoyage.(January 2012)

InMicrosoft Windows applications programming,OLE Automation (later renamed to simplyAutomation[1][2]) is aninter-process communication mechanism created byMicrosoft. It is based on a subset ofComponent Object Model (COM) that was intended for use byscripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement theIDispatch interface. It provides an infrastructure whereby applications calledautomation controllers can access and manipulate (i.e. set properties of or call methods on) sharedautomation objects that are exported by other applications. It supersedesDynamic 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 MicrosoftOLE, although some 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 limitations

[edit]

To 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.

Usage

[edit]

Automation was designed with the ease of scripting in mind, so controllers often provide languages such asVisual Basic for Applications to end users, allowing them to control automation objects via scripts. Automation objects are often written in conventional languages such asC++,[7] where C++ attributes can be used to simplify development,[8] Languages such asVisual Basic andBorland Delphi also provides a convenient syntax for Automation which hides the complexity of the underlying implementation.

Type libraries

[edit]

In 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]Due to these complications, Automation components are usually provided withtype libraries, which containmetadata about classes, interfaces and other features exposed by an object library. Interfaces are described inMicrosoft Interface Definition Language. Type libraries can be viewed using various tools, such as the Microsoft OLE/COM Object Viewer (oleview.exe, part of theMicrosoft Platform SDK) or the Object Browser in Visual Basic (up to version 6) andVisual Studio .NET. Type libraries are used to generateProxy pattern/stub code for interoperating between COM and other platforms, such asMicrosoft .NET andJava. For instance, the .NET FrameworkSDK includes tools that can generate a proxy .NET DLL to access Automation objects using both early binding (with information about interfaces extracted from a type library) and late binding (via IDispatch, mapped to the .NET Reflection API), with the built-in .NET-to-COM bridge calledCOM Interop.[11] While Java lacks built-in COM support, toolsets likeJACOB[12] and jSegue[13] can generate proxy source code (consisting of two parts, a set of Java classes and aC++ source for aJava Native Interface DLL) from type libraries. These solutions only work on Windows. Another Java based j-Interop[14] library which enables interoperability with COM components withoutJNI, using DCOM wire protocol (MSRPC) and works on non-Windows platforms also.

Microsoft has publicly documented the object model of all of the applications inMicrosoft 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 inODL.

Language support

[edit]

Automation is available for a variety of languages, including, but not limited to:

See also

[edit]

References

[edit]
  1. ^Microsoft Corporation (3 August 2021)."Automation (MFC)".MSDN.
  2. ^KruJ.; Wingo, Scott; Shepherd, George (1998). "Chapter 25: Automation".Programming Microsoft Visual C++ 6.0 (5th ed.). Redmond, WA:Microsoft Press.ISBN 978-1-57231-857-1.
  3. ^Gordon McComb (1997)."Using OLE Automation to Control WordPerfect". Archived fromthe original on 2017-08-15. Retrieved2006-07-20. — McComb describes how to use OLE Automation instead of DDE to controlWordPerfect
  4. ^Microsoft MSDN:oleautomation attribute
  5. ^Microsoft MSDN:Automation-Compatible Types
  6. ^Microsoft MSDN:Marshaling Details (COM) Type Library Marshaling community additions
  7. ^Chris Oakley."OLE Automation for C++ programmers".
  8. ^MSDN Magazine:C++ Attributes: Make COM Programming a Breeze with New Feature in Visual Studio .NET
  9. ^abYehuda Shiran and Tomer Shiran."OLE Automation in JavaScript".WebReference. — despite the title, the article discussesJScript rather thanJavaScript
  10. ^Bruce Armstrong (2006-01-16)."OLE — Extending the Capabilities of PowerBuilder (Part 2)".PowerBuilder Developers' Journal.12 (11). Archived fromthe original on 2008-02-19. Retrieved2006-07-21.
  11. ^abAppleman, Dan (2001). "Chapter 15: COM Interop and Accessing the Win32 API".Moving to VB.NET: Strategies, Concepts, and Code.Apress.ISBN 978-1-893115-97-2.
  12. ^"The JACOB Project". 2004-10-17.
  13. ^"jSegue". 2005-12-14.
  14. ^"j-Interop Java COM interoperability from any platform". Archived fromthe original on 2009-02-01. Retrieved2013-12-20.
  15. ^"How to find and use Office object model documentation".KnowledgeBase. Microsoft Corporation.
  16. ^"Compiler COM Support".MSDN. Microsoft. 3 August 2021.
  17. ^"OLE Automation using Delphi".About.com. Archived fromthe original on 2005-11-09. Retrieved2006-07-26.
  18. ^"actxserver - MATLAB Documentation".
  19. ^"Open Object Rexx". Archived fromthe original on 2005-02-07. Retrieved2009-03-20.
  20. ^Jan Dubois (Summer 1998)."Win32::OLE".The Perl Journal.3 (2).
  21. ^The PHP Group (2006-07-25)."PHP: COM and .Net (Windows)".
  22. ^Mark Hammond (20 January 2018)."Python for Windows Extensions".
  23. ^Sourceforge (17 February 2014)."Comtypes Python package".
  24. ^Tcl programmers."OLE from a Tcl perspective".
  25. ^Stan Littlefield."OLE TUTORIAL WINBATCH OLE PROGRAMMING".

Further reading

[edit]

External links

[edit]
  • OLE Automation General paper on the introduction and problems implementing OLE.
  • "VOLE - A Neat C++ COM/Automation Driver" — an open-source, compiler-independent C++ COM Automation driver library, for use when having to drive IDispatch directly. VOLE is highly robust, fully encapsulates all "low-level" aspects of IDispatch, and is very flexible, taking and returning normal C++ types.
Management
tools
Apps
Shell
Services
File systems
Server
Architecture
Security
Compatibility
API
Games
Discontinued
Games
Apps
Others
Spun off to
Microsoft Store
Retrieved from "https://en.wikipedia.org/w/index.php?title=OLE_Automation&oldid=1305082112"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp