SimpleClassFactory Class
Provides a fundamental mechanism to create a base class.
template<typename Base>
class SimpleClassFactory : public ClassFactory<>;
Base
A base class.
The base class must provide a default constructor.
The following code example demonstrates how to use SimpleClassFactory
with the ActivatableClassWithFactoryEx macro.
ActivatableClassWithFactoryEx(MyClass, SimpleClassFactory, MyServerName);
Name | Description |
---|---|
SimpleClassFactory::CreateInstance Method | Creates an instance of the specified interface. |
I0
ChainInterfaces
I0
RuntimeClassBase
ImplementsHelper
DontUseNewUseMake
RuntimeClassFlags
RuntimeClassBaseT
RuntimeClass
ClassFactory
SimpleClassFactory
Header: module.h
Namespace: Microsoft::WRL
Creates an instance of the specified interface.
STDMETHOD( CreateInstance )(
_Inout_opt_ IUnknown* pUnkOuter,
REFIID riid,
_Deref_out_ void** ppvObject
);
pUnkOuter
Must be nullptr
; otherwise, the return value is CLASS_E_NOAGGREGATION.
SimpleClassFactory doesn't support aggregation. If aggregation were supported and the object being created was part of an aggregate, pUnkOuter would be a pointer to the controlling IUnknown
interface of the aggregate.
riid
Interface ID of the object to create.
ppvObject
When this operation completes, pointer to an instance of the object specified by the riid parameter.
S_OK if successful; otherwise, an HRESULT that indicates the error.
If __WRL_STRICT__
is defined, an assert error is emitted if the base class specified in the class template parameter isn't derived from RuntimeClass, or isn't configured with the ClassicCom or WinRtClassicComMix RuntimeClassType enumeration value.