SafeArrayGetDim

This function returns the number of dimensions in the array.

At a Glance

Header file: Oleauto.h
Windows CE versions: 2.0 and later

Syntax

HRESULT SafeArrayGetDim( SAFEARRAY FAR * psa);

Parameters

psa

Pointer to an array descriptor created by SafeArrayCreate.

Return Values

Returns the number of dimensions in the array.

Remarks

Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.

Example

HRESULT
CEnumPoint::Create(SAFEARRAY FAR* psa, CEnumPoint FAR* FAR* ppenum)
{
   long lBound;
   HRESULT hresult;
   CEnumPoint FAR* penum;

   // Verify that the SafeArray is the proper shape.
   if(SafeArrayGetDim(psa) != 1)
      return ReportResult(0, E_INVALIDARG, 0, 0);

   // Code omitted here for brevity.

}