Windows apps
Collapse the table of content
Expand the table of content
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.

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

The new class instance was created successfully.

E_INVALIDARG

instance is NULL.

E_NOINTERFACE

The IInspectable interface is not implemented by the class that is associated with the current activation factory.

E_OUTOFMEMORY

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

Activation.h

IDL

Activation.idl

See also

IActivationFactory
RoActivateInstance

 

 

Show:
© 2017 Microsoft