Share via


Add Method

The Add method adds an object to a collection of SoftUSBPhysicalDescriptorSet objects.

Syntax

HRESULT Add(
  [in]            ISoftUSBPhysicalDescriptorItem *pSet,
  [in, optional]  VARIANT Index
);

Parameters

  • pSet [in]
    A pointer to a ISoftUSBPhysicalDescriptorSet interface to added to the collection

  • Index [in, optional]
    The index where Add will store the SoftUSBPhysicalDescriptorSet interface. If the caller does not specify an index for Index, the ISoftUSBPhysicalDescriptorSet interface is added at the default location.

Return Value

Add returns one of the following HRESULT values:

Return code Description
S_OK

The SoftUSBPhysicalDescriptorSet interface was correctly added to the collection.

E_INVALIDARG

The pSet pointer is not valid.

 

Examples

The following C++ code example shows how to add a ISoftUSBPhysicalDescriptorSet to the collection.

HRESULT CTestDevice:: AddPhysicalDescriptorSet (ISoftUSBPhysicalDescriptorSet *piPhysicalDescSet)
{
HRESULT              hr = S_OK;
ISoftUSBPhysicalDescriptorSetList *piPhyDescSetList = NULL; 

// Get the physical descriptor set list      
hr = m_piPhysicalDescriptor->get_Sets(&piPhyDescSetList); 
if (!FAILED(hr))
{  
        hr = piPhyDescSetList->Add(piPhysicalDescSet);
}

if(NULL != piPhyDescSetList)
{     
 piPhyDescSetList->Release();     
 piPhyDescSetList = NULL;
}

return hr;
}

Requirements

Header

SoftHidUSBif.h

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010