Creating Simple COM Servers - Overview

From RAD Studio
Jump to: navigation, search

Go Up to Creating Simple COM Servers Index

Delphi provides wizards to help you create various COM objects. The simplest COM objects are servers that expose properties and methods (and possibly events) through a default interface that clients can call.

Two wizards, in particular, ease the process of creating simple COM objects:

  • The COM Object wizard builds a lightweight COM object whose default interface descends from IUnknown or that implements an interface already registered on your system. This wizard provides the most flexibility in the types of COM objects you can create.
  • The Automation Object wizard creates a simple Automation object whose default interface descends from IDispatch. IDispatch introduces a standard marshaling mechanism and support for late binding of interface calls.

Note: COM defines many standard interfaces and mechanisms for handling specific situations. The Delphi wizards automate the most common tasks. However, some tasks, such as custom marshaling, are not supported by any Delphi wizards. For information on that and other technologies not explicitly supported by Delphi, refer to the Microsoft Developer's Network (MSDN) documentation. The Microsoft Web site also provides current information on COM support.

Overview of creating a COM object

Whether you use the Automation Object wizard to create a new Automation server or the COM object wizard to create some other type of COM object, the process you follow is the same.

To create a COM object:

  1. Design the COM object.
  2. Use the COM Object wizard or the Automation Object wizard to create the server object.
  3. Define the interface that the object exposes to clients.
  4. Register the COM object.
  5. Test and debug the application.

See Also