Click or drag to resize

GetRepCapCount

Gets the total number of repeated capability instances of the specified class.

template <typename RepCapClass>
int GetRepCapCount() const;
Parameters
RepCapClass

Template parameter specifying the repeated capability class.

Return Value

Returns the total number of repeated capability instances of the class identified by the RepCapClass template parameter.

Remarks

The count returned by this function includes the sum of the static repeated capabilities and dynamic repeated capabilities.

Example

The following example demonstrates use of the GetRepCapCount function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::PresetAll()
{
  HRESULT hr = S_OK;

  int nRepCapCount = GetRepCapCount<Acme4321Channel>();
  for (int i = 0; i < nRepCapCount; i++)
  {
    Acme4321Channel* pChannel = GetRepCap<Acme4321Channel>(i);

    // Call C++ functions on the Acme4321Channel class...
    pChannel->PresetHelper();    // Not a COM interface method
  }

  return hr;
}
See Also

Download a complete CHM version of this documentation here.