ISoftUSBConfigurations::Remove Method
The Remove method removes the specified object from a collection of SoftUSBConfiguration objects.
Syntax
HRESULT Remove(
[in] VARIANT Index
);
Parameters
- Index [in]
The index of the item to remove from the collection.
Return Value
Remove returns an HRESULT value. This method returns S_OK if the operation succeeds or E_UNEXPECTED if the collection was not been properly initialized.
Remarks
The following C++ code example how to remove an item from an ISoftUSBConfigurations collection.
HRESULT CTestDevice::RemoveFirstItemFromConfigList()
{
HRESULT hr = S_OK;
ISoftUSBConfigurations *piConfigList = NULL;
VARIANT varIndex; ::InitVariant(&varIndex);
// Get the configuration list
hr = m_piDevice->get_Configurations(&piConfigList);
if(FAILED(hr))
goto Exit;
// Remove the object from the collection
varIndex.vt = VT_I4;
varIndex.lVal = 1;
hr = piConfigList->Remove(varIndex);
if(FAILED(hr))
goto Exit;
Exit:
if (NULL != piConfigList)
{
piConfigList->Release();
piConfigList = NULL;
}
return hr;
}
Requirements
Header |
SoftUSBif.h |
Send comments about this topic to Microsoft
Build date: 9/21/2010