RAD Studio (Common)
ContentsIndex
PreviousUpNext
Active Server Object wizard

FileNewOtherActive Server Object 

Use the Active Server Object wizard to create a simple active server object. Before you create an Active Server Object, create or open the project for an application containing functionality that you want to implement. The project can be either an application or ActiveX library, depending on your needs. 

In the dialog, specify the properties of your Active Server Object, which is a special Automation object created by and called from the script running in an Active Server Page.

Item 
Description 
CoClass Name 
Specify the name for the object that you want to implement. This is the CoClass name that appears in the type library. The generated implementation class has the same name with a ‘T’ prepended.  
Instancing 
Specify an instancing mode to indicate how your Active server is launched. (This value is ignored for in-process servers.)  
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.)  
Threading Model  
Choose the threading model to indicate how COM serializes calls to your active server 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.
Active server objects can use the following threading models:  
Model 
Description 
Single 
Only one client thread can be serviced at a time. COM serializes all incoming calls to enforce this. Your code needs no thread support.  
Apartment 
Each object instantiated by a client is accessed by one thread at a time. You must protect against multiple threads accessing global memory, but objects can safely access their own instance data (object properties and members).  
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.  
 
 
Page-level event methods (OnStartPage/ OnEndPage)  
Creates an active server object that implements OnStartPage and OnEndPage. These methods are called by the web server on initialization and finalization of the page. This style of active server objects is available for use with IIS 3 and IIS 4. Active server objects used by IIS 5 should be created using the Object Context option.  
Object Context 
Creates an active server object that uses MTS or COM+ to retrieve the correct instance data of your object. Recommended for use with IIS 5 (may also work with IIS 4 and MTS).  
Generate a template test script for this object  
Optionally provide a pop-up link to a topic for the first of an unfamiliar term in a Help topic.  
Item G 
Generates a simple .ASP page that creates the Active Server Object based on its ProgID. You can then edit this Active Server page to call the methods of your object.  
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!