This documentation is archived and is not being maintained.

DECLARE_CLASSFACTORY_SINGLETON 

Declares CComClassFactorySingleton to be the class factory.


DECLARE_CLASSFACTORY_SINGLETON( 
      obj  
)

Parameters

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 CMyClass : ..., public CComCoClass< ... >
{
   ...
   DECLARE_CLASSFACTORY_SINGLETON(CMyClass)
   ...
};
Show: