IDeviceTopology::GetPartById method
The GetPartById method gets a part that is identified by its local ID.
Syntax
HRESULT GetPartById(
[in] UINT nId,
[out] IPart **ppPart
);
Parameters
- nId [in]
-
The part to get. This parameter is the local ID of the part. For more information, see Remarks.
- ppPart [out]
-
Pointer to a pointer variable into which the method writes the address of the IPart interface of the part object that is identified by nId. Through this method, the caller obtains a counted reference to the interface. The caller is responsible for releasing the interface, when it is no longer needed, by calling the interface's Release method. If the GetPartById call fails, *ppPart is NULL.
Return value
If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.
| Return code | Description |
|---|---|
|
Parameter nId is not a valid local ID. |
|
Pointer ppPart is NULL. |
Remarks
A local ID is a number that uniquely identifies a part among all the parts in a device topology. The IAudioInputSelector::GetSelection and IAudioOutputSelector::GetSelection methods retrieve the local ID of a connected part. The IAudioInputSelector::SetSelection and IAudioOutputSelector::SetSelection methods select the input or output that is connected to a part that is identified by its local ID. When you have a pointer to a part object, you can call the IPart::GetLocalId method to get the local ID of the part.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
|
Header |
|
See also
- IAudioInputSelector::GetSelection
- IAudioInputSelector::SetSelection
- IAudioOutputSelector::GetSelection
- IAudioOutputSelector::SetSelection
- IDeviceTopology Interface
- IPart Interface
- IPart::GetLocalId