Share via


CComUnkArray Class

This class stores IUnknown pointers, and is designed to be used as a parameter to the IConnectionPointImpl template class.

template<
   unsigned int nMaxSize
>
class CComUnkArray

Parameters

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

Members

Public Constructors

Name

Description

CComUnkArray::CComUnkArray

Constructor.

Public Methods

Name

Description

CComUnkArray::Add

Call this method to add an IUnknown pointer to the array.

CComUnkArray::begin

Returns a pointer to the first IUnknown pointer in the collection.

CComUnkArray::end

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

CComUnkArray::GetCookie

Call this method to get the cookie associated with a given IUnknown pointer.

CComUnkArray::GetUnknown

Call this method to get the IUnknown pointer associated with a given cookie.

CComUnkArray::Remove

Call this method to remove an IUnknown pointer from the array.

Remarks

CComUnkArray holds a fixed number of IUnknown pointers, each an interface on a connection point. CComUnkArray can be used as a parameter to the IConnectionPointImpl template class. CComUnkArray<1> is a template specialization of CComUnkArray 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 Adding Connection Points to an Object for details on automating creation of connection point proxies.

Note

Note   The class CComDynamicUnkArray is used by the Add Class wizard when creating a control which has Connection Points. If you wish to specify the number of Connection Points manually, change the reference from CComDynamicUnkArray to CComUnkArray< n >, where n is the number of connection points required.

Requirements

Header: atlcom.h

See Also

Reference

CComDynamicUnkArray Class

Other Resources

ATL Class Overview