SAFEARRAY SafeArrayCreate(
VARTYPE vt,
unsigned int cDims,
SAFEARRRAYBOUND FAR* rgsabound
);
Creates a new array descriptor, allocates and initializes the data for the array, and returns a pointer to the new array descriptor.
Points to the array descriptor, or Null if the array could not be created.
HRESULT PASCAL __export CPoly::EnumPoints(IEnumVARIANT FAR* FAR* ppenum)
{
unsigned int i;
HRESULT hresult;
VARIANT var;
SAFEARRAY FAR* psa;
CEnumPoint FAR* penum;
POINTLINK FAR* ppointlink;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = m_cPoints;
psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
if(psa == NULL){hresult = ReportResult(0, E_OUTOFMEMORY, 0, 0);
goto LError0}
// Code omitted here for brevity.
LError0:;
return hresult;
}
Windows NT: Use version 3.1 and later.
Windows: Use Windows 95 and later.
Header: Declared in oleauto.h.
Import Library: Link with oleaut32.lib.