Bagikan melalui


COleSafeArray::COleSafeArray

Constructs a COleSafeArray object.

COleSafeArray( );
COleSafeArray(
   const SAFEARRAY& saSrc,
   VARTYPE vtSrc 
);
COleSafeArray(
   LPCSAFEARRAY pSrc,
   VARTYPE vtSrc 
);
COleSafeArray(
   const COleSafeArray& saSrc 
);
COleSafeArray(
   const VARIANT& varSrc 
);
COleSafeArray(
   LPCVARIANT pSrc 
);
COleSafeArray(
   const COleVariant& varSrc 
);

Parameters

  • saSrc
    An existing COleSafeArray object or SAFEARRAY to be copied into the new COleSafeArray object.

  • vtSrc
    The VARTYPE of the new COleSafeArray object.

  • psaSrc
    A pointer to a SAFEARRAY to be copied into the new COleSafeArray object.

  • varSrc
    An existing VARIANT or COleVariant object to be copied into the new COleSafeArray object.

  • pSrc
    A pointer to a VARIANT object to be copied into the new COleSafeArray object.

Remarks

All of these constructors create new COleSafeArray objects. If there is no parameter, an empty COleSafeArray object is created (VT_EMPTY). If the COleSafeArray is copied from another array whose VARTYPE is known implicitly (a COleSafeArray, COleVariant, or VARIANT), the VARTYPE of the source array is retained and need not be specified. If the COleSafeArray is copied from another array whose VARTYPE is not known (SAFEARRAY), the VARTYPE must be specified in the vtSrc parameter.

On error, the function throws a CMemoryException or COleException.

Requirements

Header: afxdisp.h

See Also

Reference

COleSafeArray Class

Hierarchy Chart

VariantCopy Function

Other Resources

COleSafeArray Members