[in] Physical name or virtual name of the desired repeated capability instance.
GetRepCap
Gets a pointer to a child repeated capability instance.
Syntax
Section titled “Syntax”template <typename RepCapClass>RepCapClass* GetRepCap(const CString& strInstanceName) const;
template <typename RepCapClass>RepCapClass* GetRepCap(int nIndex) const;Parameters
Section titled “Parameters”strInstanceName
nIndex
[in] Zero-based index of the desired repeated capability instance.
Return value
Section titled “Return value”Returns a pointer to the repeated capability instance or NULL if the instance is not found.
Remarks
Section titled “Remarks”This function returns a pointer to a child repeated capability instance. The strInstanceName parameter may be either a physical name or a virtual name.
Since this function returns a direct pointer to the child repeated capability C++ class instance, not an interface pointer, you can call C++ functions defined on the class that are not in the public COM interface.
Example
Section titled “Example”The following example demonstrates use of the GetRepCap function.
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;}