다음을 통해 공유


COleSafeArray::GetDim

차원 수를 반환 된 COleSafeArray 개체입니다.

DWORD GetDim( );

반환 값

안전 배열의 차원 수입니다.

예제

COleSafeArray saMatrix;
DWORD numElements[] = {10, 5};

// creates a 2 dimensional safearray of type VT_I2 
// with size 10x5 elements, with all indices starting at 0(default)
saMatrix.Create(VT_I2, 2, numElements);

ASSERT(saMatrix.GetDim() == 2);

COleSafeArray saVector;
SAFEARRAYBOUND rgsabounds[] = { {5, 2} };

// creates a 1 dimensional safearray of type VT_I1 
// with size 5 elements, with the index starting at 2
saVector.Create(VT_I1, 1, rgsabounds);

ASSERT(saVector.GetDim() == 1);

요구 사항

헤더: afxdisp.h

참고 항목

참조

COleSafeArray 클래스

계층 구조 차트

COleSafeArray::Create

COleSafeArray::Redim

SafeArrayGetDim