#include <SafeArray.h>
Public Member Functions | |
CSafeArray (SAFEARRAY *psa, bool bTakeOwn=false) | |
Construct a wrapper around an existing SAFEARRAY. | |
CSafeArray () | |
Construct an empty SAFEARRAY. | |
~CSafeArray () | |
Tidy up any owned SAFEARRAY. | |
SAFEARRAY * | Copy () |
Return a copy of the encapsulated SAFEARRAY. | |
SAFEARRAY * | Detach () |
Detach the encapsulated SAFEARRAY. | |
void | Attach (SAFEARRAY *psa, bool bTakeOwn=true) |
Attach an existing SAFEARRAY. | |
void | Clear () |
Free the encapsulated array. | |
HRESULT | CreateVector (VARTYPE vt, ULONG cElements, LONG lBound=0) |
Create a vector of the given element type and length. | |
HRESULT | Create (VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound) |
Create a safearray of the given element type and dimensions. | |
HRESULT | Redim (ULONG cElements, LONG lBound=0) |
Redimension a safe array along the lowest bound. | |
UINT | Dimensions () const |
Return the number of dimensions that the array has. | |
LONG | UBound (UINT dim) const |
Return the upper bound for the given dimension. | |
LONG | LBound (UINT dim) const |
Return the lower bound for the given dimension. | |
ULONG | Count (UINT dim) const |
Return the number of elements for the given dimension. | |
HRESULT | PutElement (LONG *rgIndexes, void *elt) |
Put an element. | |
HRESULT | GetElement (LONG *rgIndexes, void *elt) |
Get an element. | |
ULONG | ElementSize () const |
Return the byte size of a single element. | |
template<class T> | |
HRESULT | AccessData (T **pbData) |
Return a direct pointer to the encapsulated array's data. | |
DECLARE_ACCESSOR (CHAR) | |
Access for CHAR arrays. | |
DECLARE_ACCESSOR (BYTE) | |
Access for BYTE arrays. | |
DECLARE_ACCESSOR (SHORT) | |
Access for SHORT arrays. | |
DECLARE_ACCESSOR (USHORT) | |
Access for USHORT arrays. | |
DECLARE_ACCESSOR (LONG) | |
Access for LONG arrays. | |
DECLARE_ACCESSOR (ULONG) | |
Access for ULONG arrays. | |
DECLARE_ACCESSOR (VARIANT) | |
Access for VARIANT arrays. | |
DECLARE_ACCESSOR (BSTR) | |
Access for BSTR arrays. | |
IDispatch ** | AccessIDispatch () |
Access for IDispatch arrays. | |
IUnknown ** | AccessIUnknown () |
Access for IUnknown arrays. | |
HRESULT | UnaccessData () |
Release access to the encapsulated data if it has been retrieved. | |
operator SAFEARRAY * () | |
Extractor for the encapsulated SAFEARRAY. |
|
Construct a wrapper around an existing SAFEARRAY.
|
|
Return a direct pointer to the encapsulated array's data.
|
|
Access for IDispatch arrays.
|
|
Access for IUnknown arrays.
|
|
Attach an existing SAFEARRAY.
|
|
Return a copy of the encapsulated SAFEARRAY.
|
|
Return the number of elements for the given dimension.
|
|
Create a safearray of the given element type and dimensions.
|
|
Create a vector of the given element type and length.
|
|
Access for BSTR arrays.
|
|
Access for VARIANT arrays.
|
|
Access for ULONG arrays.
|
|
Access for LONG arrays.
|
|
Access for USHORT arrays.
|
|
Access for SHORT arrays.
|
|
Access for BYTE arrays.
|
|
Access for CHAR arrays.
|
|
Detach the encapsulated SAFEARRAY.
|
|
Get an element.
|
|
Return the lower bound for the given dimension.
|
|
Put an element.
|
|
Redimension a safe array along the lowest bound.
|
|
Return the upper bound for the given dimension.
|
|
Release access to the encapsulated data if it has been retrieved. This function is automatically called when the class is destroyed. |