DECLARE_CLASSFACTORY_AUTO_THREAD
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

DECLARE_CLASSFACTORY_AUTO_THREAD

Declares CComClassFactoryAutoThread to be the class factory.

DECLARE_CLASSFACTORY_AUTO_THREAD( )

Remarks

CComCoClass includes the DECLARE_CLASSFACTORY macro, which specifies CComClassFactory as the default class factory. However, by including the DECLARE_CLASSFACTORY_AUTO_THREAD macro in your object's class definition, you override this default.

When you create objects in multiple apartments (in an out-of-proc server), add DECLARE_CLASSFACTORY_AUTO_THREAD to your class.

Example

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

See Also

Aggregation and Class Factory Macros | ATL Macros | DECLARE_CLASSFACTORY_EX | DECLARE_CLASSFACTORY2 | DECLARE_CLASSFACTORY_SINGLETON

Show:
© 2016 Microsoft