Export (0) Print
Expand All
Expand Minimize

DECLARE_CLASSFACTORY_SINGLETON

Declares CComClassFactorySingleton to be the class factory.

DECLARE_CLASSFACTORY_SINGLETON( 
   obj  
)

obj

[in] The name of your class object.

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

class ATL_NO_VTABLE CMySingletonClass :
   public CComObjectRootEx<CComSingleThreadModel>,
   public CComCoClass<CMySingletonClass, &CLSID_MySingletonClass>,
   public IMySingletonClass
{
public:
   DECLARE_CLASSFACTORY_SINGLETON(CMySingletonClass)

   // Remainder of class declaration omitted.

Header: atlcom.h

Show:
© 2014 Microsoft