Compartir a través de


Design Considerations for ActiveX Objects

When you expose objects to Automation, you need to decide which interfaces to implement and how to organize your objects. You should also create a type library. This section provides information to guide you in designing an Automation application.

In this section

Topic Description
Creating the Programmable Interface
An object's programmable interface comprises the properties, methods, and events that it defines.
Creating the IUnknown Interface
The IUnknown interface defines three member functions that must be implemented for each object that is exposed.
Creating the IDispatch Interface
The IDispatch interface provides a late-bound mechanism to access and retrieve information about an object's methods and properties.
Implementing Dual Interfaces
It is recommended that you implement dual interfaces because of the advantages in doing so.
Registering Interfaces
Applications that add interfaces need to register the interfaces so OLE can find the appropriate remoting code for interprocess communication.
Creating Class Identifiers
CLSIDs are universally unique identifiers (UUIDs, also called globally unique identifiers, or GUIDs) that identify class objects to OLE.
Passing Formatted Data
When handling formatted data, the application should pass an object that implements the OLE IDataObject interface.
Implementing the IEnumVARIANT Interface
Automation defines the IEnumVARIANT interface to provide a standard way for ActiveX clients to iterate over collection objects.
Implementing the _NewEnum Property
The _NewEnum property identifies an object as supporting iteration through the IEnumVARIANT interface.