ref_iface_IVDXUnknown_AsInterface - shekh/VirtualDub2 GitHub Wiki

VirtualDub Plugin SDK 1.2

IVDXUnknown interface

IVDXUnknown:: AsInterface

Obtains interfaces from an object.

void *AsInterface(uint32 iid);

Parameters

iid 32-bit interface ID of the desired interface.

Thread safety

This method is not thread-safe.

Errors

Errors may not be returned from this function (see SetError()).

Return value

A pointer to the desired interface, or NULL if the interface is not supported.

Remarks

AsInterface() is used to obtain alternate interfaces on an object, where the interface ID for an interface is typically a kIID member. This method must obey the following rules:

  • IVDXUnknown must always be available.
  • All IVDXUnknown interfaces on an object are equivalent; AddRef() on one and Release() on another is valid.
  • All interfaces must be available from all other interfaces.
  • The set of interfaces available on an object is always constant; interfaces cannot be added or removed on the fly.

This method is similar to the Microsoft COM IUnknown::QueryInterface(), but unlike that method, AsInterface() does not add a reference to the object.

It is OK to expose interfaces for a higher API version than the one in use. For instance, a filter that supports a V3 interface does not have to hide it if the host only supports V2. However, any interfaces that are exposed must work as documented — if a host advertises a V2 API but exposes a V3 interface, the V3-specific features in the interface must work. This allows a host to selectively expose V3 features.


Copyright (C) 2007-2012 Avery Lee.

⚠️ **GitHub.com Fallback** ⚠️