?/TD>
Microsoft DirectX 9.0

IDxDiagContainer::GetNumberOfChildContainers Method


Returns the number of IDxDiagContainer objects in this container.

Syntax

HRESULT GetNumberOfChildContainers(      

    DWORD *pdwCount );

Parameters

pdwCount
[out] Receives the number of IDxDiagContainer objects in the container.

Return Value

Returns S_OK if successful. Otherwise, returns the following value.

E_INVALIDARGAn invalid argument was passed to the returning function.


Example

To enumerate the names of all the child containers, use this method in a loop. This example shows how to get the number of child containers, enumerate the names of all the child containers, and retrieve instances of the child containers.

IDxDiagContainer*	pDxDiagContainer;
IDxDiagContainer*	pChildContainer;
DWORD 	dwChildCount;
DWORD	dwChildIndex;
LPWSTR	wszChildName[256];

hr = pDxDiagContainer->GetNumberOfChildContainers( &dwChildCount );
assert( SUCCEEDED(hr) );
 
for( dwChildIndex = 0; dwChildIndex < dwChildCount; dwChildIndex++ )
{
        hr = pDxDiagContainer->EnumChildContainerNames( dwChildIndex, wszChildName, 256 );
        assert( SUCCEEDED(hr) );
 
        hr = pDxDiagContainer->GetChildContainer( wszChildName, &pChildContainer );
        assert( SUCCEEDED(hr) );
 
        // Do something with pChildContainer.
 
        SAFE_RELEASE( pChildContainer );
}




© 2002 Microsoft Corporation. All rights reserved.