Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This method creates an instance of the object class supported by this class factory, given a license key previously obtained from IClassFactory2::RequestLicKey.
This method is the only possible means to create an object on an otherwise unlicensed machine.
Syntax
HRESULT CreateInstanceLic( IUnknown* pUnkOuter, IUnknown* pUnkReserved, REFIID riid, BSTR bstrKey, void** ppvObject ); |
Parameters
- pUnkOuter
-
[in] Pointer to the controlling IUnknowninterface on the outer unknown if this object is being created as part of an aggregate.
If the object is not part of an aggregate, this parameter must be NULL.
- pUnkReserved
-
[in] Unused. Must be NULL.
- riid
-
[in] Reference to the identifier of the interface to be used to communicate with the newly created object.
- bstrKey
-
[in] Run-time license key previously obtained from IClassFactory2::RequestLicKeythat is required to create an object.
- ppvObject
-
[out] Address of pointer variable that receives the interface pointer requested in riid.
Upon successful return, * ppvObjectcontains the requested interface pointer.
If an error occurs, the implementation must set * ppvObjectto NULL.
Return Value
This method supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:
- S_OK
-
The license was created.
- E_NOTIMPL
-
This method is not implemented because objects can only be created on fully licensed machines through IClassFactory::CreateInstance.
- E_POINTER
-
The pointers passed in bstrKeyor ppvObjectare not valid. For example, it can be NULL.
- E_NOINTERFACE
-
The object can be created (and the license key is valid) except the object does not support the interface specified by riid.
- CLASS_E_NOAGGREGATION
-
The pUnkOuterparameter is non-NULL, but this object class does not support aggregation.
- CLASS_E_NOTLICENSED
-
The key provided in bstrKeyis not a valid license key.
Remarks
To determine whether the platform supports this interface, see Determining Supported COM APIs.
Notes to Implementers
If the class factory does not provide a license key (that is, IClassFactory2::RequestLicKeyreturns E_NOTIMPL and the fRuntimeKeyAvailmember in LICINFOis set to FALSE in IClassFactory2::GetLicInfo), this method can also return E_NOTIMPL.
In such cases, the class factory is implementing IClassFactory2to specify whether the machine is licensed through the fLicVerifiedmember of LICINFO.
Requirements
Header | ocidl.h, ocidl.idl |
Library | ole32.lib, uuid.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |