RAD Studio (Common)
ContentsIndex
PreviousUpNext
Automation Object Wizard

FileNewOther... 

Use the New Automation Object wizard to add an Automation server to an ActiveX Library project. The wizard creates a type library, and the definition for the Automation object.

Item 
Description 
CoClass Name  
Specify the class whose properties and methods you want to expose to client applications. (Delphi prepends a T to this name.)  
Instancing  
Specify an instancing mode to indicate how your Automation server is launched.  
Threading Model  
Choose the threading model to indicate how COM serializes calls to your Automation object’s interface. The threading model you choose determines how the object is registered. You must make sure that your object implementation adheres to the model selected.  
Generate Event support code  
Check this box to tell the wizard to implement a separate interface for managing events on your Automation object. The separate interface has the name ICoClassNameEvents, and defines the event handlers that must be implemented by the client. Your application does not implement this interface.  

The Instancing dropdown list can have any of the following instancing types:

Instancing 
Meaning 
Internal  
The object can only be created internally. An external application cannot create an instance of the object directly.  
Single Instance  
Allows only a single COM interface for each executable (application), so creating multiple instances results in launching multiple instances of the application.  
Multiple Instance  
Specifies that multiple clients can connect to the application. Any time a client requests the object, a separate instance is created within a single process space. (That is, there can be multiple instances in a single executable.)  

Note: Under COM+, the serialization of calls to your object is also influenced by how it participates in activities. This can be configured using the COM+ page of the type library editor or the COM+ Component Manager.
The Threading Model dropdown list can have any of the following values:

Threading Model 
Meaning 
Single Apartment  
Only one client thread can be serviced at a time. COM serializes all incoming calls to enforce this. Your code needs no thread support.  
Free  
Each object instance may be called by multiple threads simultaneously. You must protect instance data as well as global memory.  
Both  
This is the same as the Free-threaded model, except that all callbacks supplied by clients are guaranteed to execute in the same thread. This means you do not need protect values supplied as parameters to callback functions.  
Neutral  
Multiple clients can call the object on different threads at the same time, but COM ensures that no two calls conflict. You must guard against thread conflicts involving global data and any instance data that is accessed by more than one method. This model should not be used with objects that have a user interface. This model is only available under COM+. Under COM, it is mapped to the Apartment model.  

Note: Under COM+, the serialization of calls to your object is also influenced by how it participates in activities. This can be configured using the COM+ page of the type library editor or the COM+ Component Manager.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!