ATL

From RAD Studio
Jump to: navigation, search

Go Up to Project Options Dialog Box


Project > Options > ATL

Use this dialog box to specify ATL (Active Template Library) options. These options apply to every COM server in the project.

Note: DAX (the Delphi ActiveX framework) has replaced ATL for C++ ActiveX and COM projects beginning with C++Builder XE. Therefore, this ATL page does not appear in Project Options unless you open a pre-existing project that uses ATL. See C++Builder Uses DAX for ActiveX and COM for information about how to continue to use ATL in C++Builder XE.
Item Description

Single Use

An instance of the COM server object is created for each client.

Multiple Use

All clients operate on a single instance of the COM server object.

APARTMENTTHREADED

An object is referenced only by the thread in which it was constructed. Use this option for projects that contain only single-threaded and apartment-threaded objects.

MULTITHREADED

Objects can be referenced by any thread. Use this option for projects that contain free-threaded, both-threaded, or neutral-threaded objects.

Single

All COM server objects are implemented using a single thread.

Apartment

The project may be multi-threaded, but each instance of the COM server object must has its own dedicated thread for OLE calls.

Free

The project may be multithreaded and each instance of the COM server object can receive simultaneous requests from multiple threads. Your code must provide thread concurrency support.

Both

Same as Free except that outgoing calls such as callbacks are guaranteed to execute in the same thread.

Neutral

Multiple clients can call the object on different threads at the same time, but COM ensures that no two calls conflict.

Trace Query Interface

Sends a message to the event log whenever a client makes a QueryInterface call. The event log also shows the status of the call.

Check Ref Counts

message is sent to the event log whenever the reference count of a COM server object is increased or decreased. When Check Ref Counts is enabled, an assertion occurs if the project attempts to release the object from memory with a nonzero reference count.

General Tracing

Sends a messages to the event log when an ATL function is called.

Note: Threading Model options are provided only for backward compatibility. You now specify threading models on a per-object basis.

See Also