The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
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.
Example
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.
Requirements
Header: atlcom.h
Show: