Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Declares CComClassFactorySingleton to be the class factory.
DECLARE_CLASSFACTORY_SINGLETON(
obj
)
Parameters
- obj
[in] The name of your class object.
Remarks
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
See Also
Reference
DECLARE_CLASSFACTORY_AUTO_THREAD