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 |
|
|
|
|
UpdateFrequency5 |
[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.
CBaseObject(
const TCHAR *pName
);
-
pName
-
String that contains the name of the object, for debugging purposes.
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.
Requirement | Value |
---|---|
Header |
|
Library |
|