DECLARE_CLASSFACTORY2
Declares CComClassFactory2 to be the class factory.
DECLARE_CLASSFACTORY2(
lic
)
Параметры
- lic
[in] A class that implements VerifyLicenseKey, GetLicenseKey, and IsLicenseValid.
Заметки
CComCoClass includes the DECLARE_CLASSFACTORY macro, which specifies CComClassFactory as the default class factory. However, by including the DECLARE_CLASSFACTORY2 macro in your object's class definition, you override this default.
Пример
class ATL_NO_VTABLE CMyClass2 :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CMyClass2, &CLSID_MyClass>,
public IDispatchImpl<IMyClass, &IID_IMyClass, &LIBID_NVC_ATL_COMLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
public IDispatchImpl<IMyDualInterface, &__uuidof(IMyDualInterface), &LIBID_NVC_ATL_COMLib, /* wMajor = */ 1, /* wMinor = */ 0>
{
public:
DECLARE_CLASSFACTORY2(CMyLicense)
// Remainder of class declaration omitted
Требования
Header: atlcom.h
См. также
Основные понятия
Aggregation and Class Factory Macros