?/TD> |
Microsoft DirectX 9.0 |
Retrieves a pointer to the child container specified.
Syntax
HRESULT GetChildContainer(
LPCWSTR pwszContainer, IDxDiagContainer **ppInstance );
Parameters
- pwszContainer
- [in] Specifies the NULL-terminated name of the container.
- ppInstance
- [out] Receives an instance of the child IDxDiagContainer specified by pwszContainer.
Return Value
If unsuccessful, returns one of the following values.
E_INVALIDARG An invalid argument was passed to the returning function. E_OUTOFMEMORY Could not allocate sufficient memory to complete the call.
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 ); }