IMFActivate::ActivateObject method (mfobjects.h)

Creates the object associated with this activation object.


HRESULT ActivateObject(
  [in]  REFIID riid,
  [out] void   **ppv


[in] riid

Interface identifier (IID) of the requested interface.

[out] ppv

Receives a pointer to the requested interface. The caller must release the interface.

Return value

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


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.


Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfobjects.h
Library Mfuuid.lib

See also

Activation Objects