Share via


DECLARE_ONLY_AGGREGATABLE

DECLARE_ONLY_AGGREGATABLE( x )

Parameters

x

[in] The name of the class object you are defining as only aggregatable.

Remarks

Specifies that your object must be aggregated. DECLARE_ONLY_AGGREGATABLE causes an error (E_FAIL) if an attempt is made to CoCreate your object as nonaggregated object.

By default, CComCoClass contains the DECLARE_AGGREGATABLE macro, which specifies that your object can be aggregated. To override this default behavior, include DECLARE_ONLY_AGGREGATABLE in your class definition. For example:

class CMyClass : public CComCoClass< .. >, ...
{
public:
   DECLARE_ONLY_AGGREGATABLE(CMyClass)
   ...
};

ATL Macros and Global Functions

See Also

DECLARE_NOT_AGGREGATABLE