CComUnkArray

template< unsigned int nMaxSize >
class CComUnkArray

Parameters

nMaxSize The maximum number of IUnknown pointers that can be held in the static array.

CComUnkArray holds a fixed number of IUnknown pointers, each an interface on a particular connection point. CComUnkArray can be used as a parameter to the IConnectionPointImpl template class. CComUnkArray<1> is a template specialization that has been optimized for one connection point.

The CComUnkArray methods begin and end can be used to loop through all connection points (for example, when an event is fired).

See the article The Proxy Generator for details on automating the creation of connection point proxies.

#include <atlcom.h>

See Also CComDynamicUnkArray


CComUnkArray Class Members

Methods
beginReturns a pointer to the first IUnknown pointer in the collection.
CComUnkArrayConstructor.
endReturns a pointer to one past the last IUnknown pointer in the collection.

CComUnkArray Overview


Methods

CComUnkArray::begin

IUnknown** begin( );

Return Value

A pointer to an IUnknown interface pointer.

Remarks

Returns a pointer to the beginning of the collection of IUnknown interface pointers.

The collection contains pointers to interfaces stored locally as IUnknown. You cast each IUnknown interface to the real interface type and then call through it. You do not need to query for the interface first.

Before using the IUnknown interface you should check that it is not NULL.

CComUnkArray Overview | Class Members

See Also CComUnkArray::end


CComUnkArray::CComUnkArray

CComUnkArray( );

Remarks

The constructor. Sets the collection to hold nMaxSize IUnknown pointers, and initializes the pointers to NULL.

CComUnkArray Overview | Class Members


CComUnkArray::end

IUnknown* end( );

Return Value

A pointer to an IUnknown interface pointer.

Remarks

Returns a pointer to one past the last IUnknown pointer in the collection.

The CComUnkArray methods begin and end can be used to loop through the all connection points, for example, when an event is fired.

IUnknown** p = m_vec.begin(); 
while(p != m_vec.end()) 
{ 
   // Do something with *p 
   p++; 
} 

CComUnkArray Overview | Class Members

See Also CComUnkArray::begin