Partager via


COleSafeArray Class

A class for working with arrays of arbitrary type and dimension.

class COleSafeArray : public tagVARIANT

Members

Public Constructors

Name

Description

COleSafeArray::COleSafeArray

Constructs a COleSafeArray object.

Public Methods

Name

Description

COleSafeArray::AccessData

Retrieves a pointer to the array data.

COleSafeArray::AllocData

Allocates memory for the array.

COleSafeArray::AllocDescriptor

Allocates memory for the safe array descriptor.

COleSafeArray::Attach

Gives control of the existing VARIANT array to the COleSafeArray object.

COleSafeArray::Clear

Frees all data in the underlying VARIANT.

COleSafeArray::Copy

Creates a copy of an existing array.

COleSafeArray::Create

Creates a safe array.

COleSafeArray::CreateOneDim

Creates a one-dimensional COleSafeArray object.

COleSafeArray::Destroy

Destroys an existing array.

COleSafeArray::DestroyData

Destroys data in a safe array.

COleSafeArray::DestroyDescriptor

Destroys a descriptor of a safe array.

COleSafeArray::Detach

Detaches the VARIANT array from the COleSafeArray object (so that the data will not be freed).

COleSafeArray::GetByteArray

Copies the contents of the safe array into a CByteArray.

COleSafeArray::GetDim

Returns the number of dimensions in the array.

COleSafeArray::GetElement

Retrieves a single element of the safe array.

COleSafeArray::GetElemSize

Returns the size, in bytes, of one element in a safe array.

COleSafeArray::GetLBound

Returns the lower bound for any dimension of a safe array.

COleSafeArray::GetOneDimSize

Returns the number of elements in the one-dimensional COleSafeArray object.

COleSafeArray::GetUBound

Returns the upper bound for any dimension of a safe array.

COleSafeArray::Lock

Increments the lock count of an array and places a pointer to the array data in the array descriptor.

COleSafeArray::PtrOfIndex

Returns a pointer to the indexed element.

COleSafeArray::PutElement

Assigns a single element into the array.

COleSafeArray::Redim

Changes the least significant (rightmost) bound of a safe array.

COleSafeArray::ResizeOneDim

Changes the number of elements in a one-dimensional COleSafeArray object.

COleSafeArray::UnaccessData

Decrements the lock count of an array and invalidates the pointer retrieved by AccessData.

COleSafeArray::Unlock

Decrements the lock count of an array so it can be freed or resized.

Public Operators

Name

Description

COleSafeArray::operator LPCVARIANT

Accesses the underlying VARIANT structure of the COleSafeArray object.

COleSafeArray::operator LPVARIANT

Accesses the underlying VARIANT structure of the COleSafeArray object.

COleSafeArray::operator =

Copies values into a COleSafeArray object (SAFEARRAY, VARIANT, COleVariant, or COleSafeArray array).

COleSafeArray::operator ==

Compares two variant arrays (SAFEARRAY, VARIANT, COleVariant, or COleSafeArray arrays).

COleSafeArray::operator <<

Outputs the contents of a COleSafeArray object to the dump context.

Remarks

COleSafeArray derives from the OLE VARIANT structure. The OLE SAFEARRAY member functions are available through COleSafeArray, as well as a set of member functions specifically designed for one-dimensional arrays of bytes.

Inheritance Hierarchy

tagVARIANT

COleSafeArray

Requirements

Header: afxdisp.h

See Also

Reference

Hierarchy Chart

COleVariant Class

CRecordset Class

CDatabase Class