Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RoActivateInstance function

Activates the specified Windows Runtime class.

Syntax


HRESULT WINAPI RoActivateInstance(
  _In_   HSTRING activatableClassId,
  _Out_  IInspectable **instance
);

Parameters

activatableClassId [in]

Type: HSTRING

The class identifier that is associated with the activatable runtime class.

instance [out]

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 codeDescription
S_OK

The class was activated successfully.

E_POINTER

instance is NULL.

CO_E_NOTINITIALIZED

The thread has not been initialized in the Windows Runtime by calling the RoInitialize function.

E_ACCESSDENIED

The TrustLevel for the class requires a full-trust process.

E_NOINTERFACE

The IInspectable interface is not implemented by the specified class.

E_OUTOFMEMORY

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.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Roapi.h

See also

CoCreateInstance
IActivationFactory
IInspectable
TrustLevel

 

 

Community Additions

Show:
© 2014 Microsoft