IObjectControl::CanBePooled method

Notifies the COM+ run-time environment whether the object can be pooled for reuse when it is deactivated.


BOOL CanBePooled(



This method has no parameters.

Return Value

If the object can be pooled for reuse, the return value is TRUE. Otherwise, it is FALSE.


When an object returns TRUE from the CanBePooled method, it indicates to the COM+ run-time environment that it can be added to an object pool after deactivation rather than being destroyed. Whenever an instance is required, one is drawn from the pool rather than created.

Returning TRUE from the CanBePooled method does not guarantee that objects will be recycled; it only gives the COM+ run-time environment permission to recycle them. Returning FALSE from the CanBePooled method guarantees that instances of a component are not recycled.

The Activate method is called if a new instance is created or if a recycled instance is drawn from the pool. Similarly, the Deactivate method is called every time the object is deactivated, whether it is being destroyed or returned to the pool for recycling.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header comsvcs.h

See Also

COM+ Object Pooling

How Object Pooling Works


Requirements for Poolable Objects