Muokkaa

Jaa


CBaseObject.CBaseObject constructor

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

Constructor method.

Syntax

CBaseObject(
   const TCHAR *pName
);

Parameters

pName

String that contains the name of the object, for debugging purposes.

Remarks

This method increments the active-object count. (See CBaseObject::ObjectsActive.)

Allocate the pName parameter in static memory:

// Correct.
CBaseObject *pObject = new CBaseObject(NAME("My Object"));

// Incorrect.
TCHAR ObjectName[] = TEXT("My Object");
CBaseObject *pObject = new CObject(ObjectName);

The NAME macro compiles to NULL in retail builds, so that static strings appear only in debug builds. For more information, see DbgDumpObjectRegister.

Requirements

Requirement Value
Header
Combase.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseObject Class