ACDUAL: Adds Dual Interfaces to an Automation Application

Click to open or copy the ACDUAL project files.

ACDUAL demonstrates how to add dual-interface support to an MFC-based Automation (formerly OLE Automation) application. The sample consists of the following subdirectories:

The ACDUAL server uses AUTOCLIK, Step 3 as a starting point. New GUIDs (globally unique identifiers) were generated to prevent confusion with the original AUTOCLIK sample, and some resources strings were changed to clarify whether the ACDUAL server is running. All other changes to the sources are marked with comment blocks like this:

      // DUAL_SUPPORT_START
      ... modified code goes here
      // DUAL_SUPPORT_END

For more information about dual interfaces, object description language (ODL) scripts, and Automation error interfaces, see Technical Note 65.

Running the Sample

You must run ACDUAL as a stand-alone application once to register its ActiveX type with the system. After this is done, you are ready to run either the VB or MFC version of AUTODRIV. Both versions of AUTODRIV launch ACDUAL and create a Document object, which you can then manipulate using Automation via the AUTODRIV user interface. The MFC version of AUTODRIV contains an additional check box that lets you select whether to use VTBL binding to communicate with the ACDUAL Document object.

Dual Interfaces

A dual interface allows you to implement an IDispatch interface or a VTBL interface. A dual interface is strongly recommended for all exposed Automation objects. Issues to consider when implementing a dual interface are discussed in Technical Note 65 and include:

See also the ActiveX topics Overview of Automation, Dual Interfaces, Type Description Interfaces, and the ODL reference entry on the dual attribute.