Skip to content

Latest commit

 

History

History
94 lines (55 loc) · 2.53 KB

cbaseobject-cbaseobject.md

File metadata and controls

94 lines (55 loc) · 2.53 KB
description ms.assetid title ms.topic ms.date topic_type api_name api_type api_location ms.custom
CBaseObject.CBaseObject constructor - Constructor method.
20c3c4af-b22f-4b74-a6b6-5ee309de4eef
CBaseObject.CBaseObject constructor (Combase.h)
reference
4/26/2023
APIRef
kbSyntax
CBaseObject.CBaseObject
COM
Strmbase.lib
Strmbase.dll
Strmbasd.lib
Strmbasd.dll
UpdateFrequency5

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