![]() | GetRepCapItem |
Gets the root interface pointer of a child repeated capability instance.
template <typename RepCapClass, typename ItfType> HRESULT GetRepCapItem(CComBSTR bstrInstanceName, ItfType** ppRepCap);
Template parameter identifying the repeated capability class.
[in] Physical name or virtual name of the desired repeated capability instance.
[out] Pointer to the root interface of the repeated capability instance identified by the RepCapClass and bstrInstanceName parameters.
Returns S_OK if successful, otherwise a failure HRESULT.
The signature of this function is specifically designed to match that of the standard Item method found on all collection-style repeated capabilities.
The following example demonstrates use of the GetRepCapItem function.
// CoAcme4321.cpp HRESULT Acme4321::IAcme4321Channels_get_Item(BSTR Name, IAcme4321Channel** val) { HRESULT hr = S_OK; hr = GetRepCapItem<Acme4321Channel>(Name, val); return hr; }