CBaseObject class

The CBaseObject class is an abstract class for implementing DirectShow objects. To implement Component Object Model (COM) objects, use the CUnknown class, which derives from CBaseObject.

Class MethodsDescription
CBaseObject Constructor method.
~CBaseObject Destructor method.
ObjectsActive Retrieves the count of active objects.



Most of the DirectShow base classes derive from CBaseObject. This class provides debugging assistance by keeping a count of all the DirectShow objects active during run time. The object count is stored in a class-static member variable:

class CBaseObject
    static LONG m_cObjects;  // Total number of objects active. 
/* ... */

In debug builds, the DLL will assert if it is unloaded while the object count is greater than zero. This makes it easier to track down leaks caused by reference-counting problems.

The CBaseObject constructor takes one argument, a debugging name for the object. This name is stored in a global table in the DLL. The DbgDumpObjectRegister function formats a list of the objects active in the DLL, and sends it to the debug output.



Combase.h (include Streams.h)


Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

DirectShow Base Classes