IMFActivate::ActivateObject Method

Creates the object associated with this activation object.

Syntax

public:
HRESULT ActivateObject(
         REFIID riid,
         void **ppv
)  

Parameters

riid
Type: REFIID 

[in] Interface identifier (IID) of the requested interface.

ppv
Type: void **

[out, optional] Receives a pointer to the requested interface. The caller must release the interface.

Return value

Type: HRESULT 

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Refer to Media Foundation return codes.

Remarks

Some Microsoft Media Foundation objects must be shut down before being released. If so, the caller is responsible for shutting down the object that is returned in ppv. To shut down the object, do one of the following:

The IMFActivate::ShutdownObject method is generic to all object types. If the object does not require a shutdown method, ShutdownObject succeeds and has no effect. If you do not know the specific shutdown method for the object (or do not know the object type), call IMFActivate::ShutdownObject.

After the first call to ActivateObject, subsequent calls return a pointer to the same instance, until the client calls either ShutdownObject or IMFActivate::DetachObject.

Requirements

Header: Declared in mfobjects.h (include mfidl.h).

Library: Use Mfuuid.lib.