IActivationFactory::ActivateInstance method
Creates a new instance of the Windows Runtime class that is associated with the current activation factory.
Syntax
HRESULT ActivateInstance( [out] IInspectable **instance );
Parameters
- instance [out]
-
Type: IInspectable**
A pointer to a new instance of the class that is associated with the current activation factory.
Return value
Type: HRESULT
This function can return the following values.
| Return code | Description |
|---|---|
|
The new class instance was created successfully. |
|
instance is NULL. |
|
The IInspectable interface is not implemented by the class that is associated with the current activation factory. |
|
Failed to create an instance of the class. |
Remarks
Use the ActivateInstance function to activate a Windows Runtime class. The ActivateInstance function connects to the activation factory that is associated with the specified activatable class identifier, creates an instance by calling the zero-argument constructor on the class, and releases the activation factory.
Requirements
|
Minimum supported client |
Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2012 [desktop apps | Windows Store apps] |
|
Header |
|
|
IDL |
|
See also