![]() | GetRepCapCount |
Gets the total number of repeated capability instances of the specified class.
template <typename RepCapClass> int GetRepCapCount() const;
Template parameter specifying the repeated capability class.
Returns the total number of repeated capability instances of the class identified by the RepCapClass template parameter.
The count returned by this function includes the sum of the static repeated capabilities and dynamic repeated capabilities.
The following example demonstrates use of the GetRepCapCount function.
// 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; }