Creating Simple COM Servers - Overview
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:
- Design the COM object.
- Use the COM Object wizard or the Automation Object wizard to create the server object.
- Define the interface that the object exposes to clients.
- Register the COM object.
- Test and debug the application.