RoActivateInstance function (roapi.h)
Activates the specified Windows Runtime class.
Syntax
HRESULT RoActivateInstance(
[in] HSTRING activatableClassId,
[out] IInspectable **instance
);
Parameters
[in] activatableClassId
Type: HSTRING
The class identifier that is associated with the activatable runtime class.
[out] instance
Type: IInspectable**
A pointer to the activated instance of the runtime class.
Return value
Type: HRESULT
This function can return one of these values.
Return code | Description |
---|---|
|
The class was activated successfully. |
|
instance is NULL. |
|
The thread has not been initialized in the Windows Runtime by calling the RoInitialize function. |
|
The TrustLevel for the class requires a full-trust process. |
|
The IInspectable interface is not implemented by the specified class. |
|
Failed to create an instance of the class. |
Remarks
Use the RoActivateInstance function to activate a Windows Runtime class. The RoActivateInstance 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
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2012 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | roapi.h |