Navigation:  Programming Cookbook > External Interfacing > External Arrays >

COM/.Active-X Array Types

Previous pageReturn to chapter overviewNext page

The standard image includes a few special ExternalArray types associated with the OLE COM and Active-X Automation support. These are the counted arrays and SAFEARRAYs, respectively.

Counted Arrays

OLECountedArrays are really just a structure containing a size and an an indirection to the actual location at which the array is stored. They are used in OLE in order to encapsulate an array and its size to simplify parameter passing and memory management, especially for ease of marshalling. They are not much used, but some examples can be found in the Active-X Control Hosting package where they are used as parameters to certain methods in the IPerPropertyBrowsing interfac.e.


SAFEARRAY is the Basic/Automation array type. It can be used to hold the same types of values as can be stored in VARIANTs, including arrays of VARIANTs. It should only ever be used in conjunction with Automation interfaces (subclasses of IDispatch).