Export (0) Print
Expand All
ATL
Expand Minimize
This topic has not yet been rated - Rate this topic

DECLARE_CLASSFACTORY_EX

Declares cf to be the class factory.

DECLARE_CLASSFACTORY_EX( 
   cf  
)
cf

[in] The name of the class that implements your class factory object.

The cf parameter must derive from CComClassFactory and override the CreateInstance method.

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


class ATL_NO_VTABLE CMyCustomClass :
   public CComObjectRootEx<CComSingleThreadModel>,
   public CComCoClass<CMyCustomClass, &CLSID_MyCustomClass>,
   public IDispatchImpl<IMyCustomClass, &IID_IMyCustomClass, &LIBID_NVC_ATL_COMLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
   DECLARE_CLASSFACTORY_EX(CMyClassFactory)

   // Remainder of class declaration omitted.


Header: atlcom.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.