COleSafeArray::GetLBound

更新 : 2007 年 11 月

COleSafeArray オブジェクトの任意の次元の下限を返します。

void GetLBound(
   DWORD dwDim,
   long* pLBound 
);

パラメータ

  • dwDim
    下限を取得する配列の次元。

  • pLBound
    下限を返すバッファへのポインタ。

解説

エラーの場合、関数は COleException クラス をスローします。

使用例

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);

long lLBound;

//get lower bound for 1st dimension
saMatrix.GetLBound(1, &lLBound);

ASSERT(lLBound == 0);

//get lower for 2nd dimension
saMatrix.GetLBound(2, &lLBound);

ASSERT(lLBound == 0);

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

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

//get lower bound for 1st dimension
saVector.GetLBound(1, &lLBound);

ASSERT(lLBound == 1);

必要条件

ヘッダー : afxdisp.h

参照

参照

COleSafeArray クラス

階層図

COleSafeArray::GetUBound

SafeArrayGetLBound

その他の技術情報

COleSafeArray のメンバ