Microsoft Windows CE 3.0  

CUnknown Class

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

All Microsoft DirectShow Component Object Model (COM) objects derive from the CUnknownabstract base class. This class facilitates the creation of simple COM objects that you can combine with other COM objects to support multiple interfaces. To use this class, derive your object from CUnknownand call the DECLARE_IUNKNOWNmacro in the public section of your object class definition; this implements the IUnknowninterface for your object. Note that if derive from an object that has already done this, such as CBaseFilter, you do not need to do it yourself.

The CUnknownclass supports only one interface, IUnknown. To support interfaces in addition to those provided by the base class, override the NonDelegatingQueryInterfacemethod. In the overriding function, call the GetInterfacefunction to retrieve the interface pointer for any interfaces your object supports. If the derived class does not implement the specified interface, you must query the base class to retrieve the interface.

For example, CBaseFiltersupports the following interfaces directly.