Rhubbarb
Rhubbarb

Reputation: 4388

What is an "automation-compatible language"?

I have found many references to this term on the web, especially on Microsoft's MSDN website, and even lists of such languages. However, I can't find a definition of this term. (Is it something as simple as a language for which a COM interface has been implemented?)

Please let me know if you know of a link to a definition.

Thanks.

Upvotes: 2

Views: 340

Answers (2)

Hans Passant
Hans Passant

Reputation: 941505

Stripped down to bare essentials, to understand COM you have to understand GUIDs and IUnknown. The equivalent for Automation is ProgIDs and IDispatch.

A ProgID helps you create a COM coclass. A typical ProgID is "Word.Automation", the progid for Microsoft Word. You'll find them listed in the Registry under HKEY_CLASSES_ROOT. A typical name for a helper function in your language is CreateObject(). You pass it the ProgID, optionally a machine name, and you get back an interface reference. Which you can then use to make method calls and get/set properties.

The language runtime uses the IDispatch interface (retrieved with IUnknown::QueryInterface) to discover the names and parameters of the methods that are implemented by the COM server. This is called late-binding, the way any scripting language uses Automation. It has only 4 methods:

  • IDispatch::GetTypeInfoCount(), returns 1 if the server can provide type info
  • IDispatch::GetTypeInfo(), returns type information, helpful to make type-safe calls
  • IDispatch::GetIDsOfNames(), maps an identifier name to a number
  • IDispatch::Invoke(), calls a numbered method or property getter/setter.

That's all it takes.

Upvotes: 5

cuneyt
cuneyt

Reputation: 366

In Microsoft Windows applications programming, OLE Automation (later renamed by Microsoft to just Automation,1[2] although the old term remained in widespread use), is an inter-process communication mechanism based on Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now are used by languages run on Windows.[3] 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.

From Wikipedia entry

Upvotes: 1

Related Questions