Click or drag to resize

GetRepCapItem

Gets the root interface pointer of a child repeated capability instance.

template <typename RepCapClass, typename ItfType>
HRESULT GetRepCapItem(CComBSTR bstrInstanceName, ItfType** ppRepCap);
Parameters
RepCapClass

Template parameter identifying the repeated capability class.

bstrInstanceName

[in] Physical name or virtual name of the desired repeated capability instance.

ppRepCap

[out] Pointer to the root interface of the repeated capability instance identified by the RepCapClass and bstrInstanceName parameters.

Return Value

Returns S_OK if successful, otherwise a failure HRESULT.

Remarks

The signature of this function is specifically designed to match that of the standard Item method found on all collection-style repeated capabilities.

Example

The following example demonstrates use of the GetRepCapItem function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::IAcme4321Channels_get_Item(BSTR Name, IAcme4321Channel** val)
{
    HRESULT hr = S_OK;

    hr = GetRepCapItem<Acme4321Channel>(Name, val);

    return hr;
}
See Also

Download a complete CHM version of this documentation here.